Answer the question
In order to leave comments, you need to log in
Can a browser cache js files passed to it?
Can a browser cache js files passed to it?
Let's say, when requested, it reports to the server the hash of the cache that it has. The server compares the hashes of the cache and js files prepared for sending and either updates them (gives new ones) or reports that there are no changes.
Answer the question
In order to leave comments, you need to log in
So the cache works.
If pragma: no-cache is not received in the header, then it caches
By default, this is how it works.
But you can make your own caching system in localStorage.
Usually, this is necessary for SPA / PWA single-page applications with complex data processing logic in js and with full control of the network connection status , because correct operation is required in the absence of an Internet connection: offline mode.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question