0

I'm wandering how does browser caches the javascript files. I have utility.js and I use it on multiple pages. I know that when I go to www.some_host/page1.html the utility.js is cached for that request. What happens if I go to different page www.some_host/page2.html, utility.js is requested again from server or take it from browser cache?

2 Answers 2

1

Everything is cached based on its own URI. It doesn't matter what caused the browser to load it (unless you have something like Vary: referer in the headers, which I've never seen)

Sign up to request clarification or add additional context in comments.

Comments

1

The browser normally follows the caching rules employed for the other resources (pages, images etc...)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.