On what basis does javascript files get cached? Say I load a file with the name ‘m-script.js’ from one site and on another website I use the same name ‘m-script.js’ but with different contents. Will the browser fetch the new one, or just look at the name and load it from the cache? The urls for both the m-script.js file are different (obviously).
Thanks.
On what basis does javascript files get cached? Say I load a file with
Share
If the url is different the cached copy will not be used. A new request will be made and the new file will be downloaded.
There would be a huge security and usability issue with the browser if a Javascript file cached from one website was used on another.