HTTP Caching HTTP responses Changing cached resources


Example

The easiest method to bypass cache is to change the URL. This is used as a best practice when the URL contains a version or a checksum of the resource, e.g.

http://example.com/image.png?version=1
http://example.com/image.png?version=2

These two URLs will be cached separately, so even if …?version=1 was cached forever, a new copy could be immediately retrieved as …?version=2.

Please don't use random URLs to bypass caches. Use Cache-control: no-cache or Cache-control: no-store instead. If responses with random URLs are sent without the no-store directive, they will be unnecessarily stored in caches and push out more useful responses out of the cache, degrading performance of the entire cache.