I know that this is probably obvious, since you can understand that the "versioning" method for cache invalidation works for any requested static resource, but if it is missing, I will connect here.
We allow branding for some of our applications, and this means that image files change very often during the lifetime of customers with us, as well as the other static files mentioned earlier. If the same name should be used for a file, caching is a problem. Conveniently, the idea of a version for the image source works just as well.
<img src="images/title.gif?v=2" />
In addition, it is not necessary to mention this, but the term "invalid cache" in this regard is not technically correct. To invalidate the cache, you must delete the cache entries. There is no real way to programmatically do this for the browser. In fact, we are talking about the fact that the web server is requesting a new file due to a change in the file name, rather than forcing the deletion of the original file. You can easily test this by changing the file version back and forth between the unused version and the older version, and review the HTTP 200 and 304 responses accordingly.

AlienFromCA
source share