Invalidating a cache

by  |  01-Jun-2019 17:54

The only downside I've come across is that by some of the caching stuff being done, small changes to JS and CSS tend not to cause a new copy of the files to download.

What we are actually talking about here is asking the web-server for a new file due the name of the file changing, not forceably removing the original file.

You can easily test this by changing a file version back and forth between an unused version, and an older used version, and seeing the HTTP 200 and 304 responses respectively. It does a lot of the stuff you are worrying about automatically and it does handle cache invalidation by using differently named css files every time they are modified.

Handily, the idea of versioning the source of an image works just as well.

Also, it is probably not important to mention this, but, the term "invalidating cache" in this regard, is not technically correct.

Cache Invalidation is one of the two techniques of maintaining cache coherency in a system where multiple cores share a lower level cache.

Community Discussion