Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery hosted on Google CDN: why is Internet access still needed?

I am using jQuery from google CDN.

I looked at the cache-control and it seems the browser should fully cache the jQuery version for a long time.

However when I disable Internet access my webpages stop working. Why? Is it because even though jQuery is cached, the browser still needs to resolve DNS?

like image 420
Roger Avatar asked Jan 23 '26 17:01

Roger


1 Answers

Your brower doesn't need to respect the cache-control header. That is mostly used by proxies. If you want to check whether your browser is keeping a local copy of the script, go into offline mode (in your browser) and try if your website still works.

In addition you might want to enable the Firebug (if you're using Firefox) Net panel to see the exact request your browser sends to the server (and what the response is).

like image 144
shartte Avatar answered Jan 26 '26 05:01

shartte



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!