Chrome – Disable cache for localhost only?

You can certainly prevent all your file from hitting the cache, but this is an all-or-nothing setting. You can’t decide which files get cleared from the cache and which files stay in the cache.

During development, since you are using Chrome, I’d recommend to enable the setting for “Disable cache (while DevTools is open)”:

Disable cache (while DevTools is open)

If you are like me, cache will be disabled every time you have the DevTools panel opened.

Another thing you can do is to instruct your server to bypass cache altogether for all your resources. Since jQuery is coming from a CDN, this no-cache setting won’t apply for it. To disable cache for resources you can include the following response header:

Cache-Control:no-cache, no-store

Leave a Comment