This is a tip you may already know about, because browsers have supported the feature for many years.
If you hold down the SHIFT key while refreshing a page (e.g. type CMD-SHIFT-R or hold SHIFT when clicking the Refresh button in the tool-bar), it will tell the browser to ignore cached content when reloading the page.
This is a great way to resolve problems when something doesn’t seem to have loaded correctly. Web site managers will frequently tell you to clear your cache to solve problems, but that’s a pain in the neck. You need to dig through various screens in your browser’s preferences in order to find the button to do this, and when you do, all web pages will need to reload everything, slowing down their load times until the cache gets re-populated.
Simply holding down SHIFT while reloading is much better. It’s immediately available, so it won’t distract you from what you were doing. And it only reloads the cached content used by that page.
This feature is known to be available with Firefox (source), Chrome (source) and Microsoft Edge (source).
On Apple Safari, use the OPTION key instead of SHIFT. (CMD-SHIFT-R opens the page in Reader view). (source).
I suspect most other browsers will also support this feature.
Safari’s View menu actually tells you what modifier you need to press to load the page from the remote server rather than from cache. It’s actually opt-cmd-r. Either that or you hold opt while you click reload in Safari.
I use an extension called Forget Me Not in Firefox, which has a popdown menu to “Clean this domain”, and another extension called Empty Cache. I’m not sure what the difference is between what those two extensions do… I think Forget Me Not does more than just empty the cache… while the tip you describe (Shift Refresh) just ignores the cache for that reload, but doesn’t delete it… as far as I know.
As I understand it, the cache remembers the most recent data corresponding to each URL (including the URLs for embedded/inline objects, not just the one visible in the location bar), not every version you may have downloaded. So when you do a shift-reload, the newly downloaded content should replace any cached version of the page’s URLs.
An actual cache-clear would delete all content (or all content belonging to the domain) instead of just replacing the content for the page’s URLs.
This might save some storage space in the cache directory, but I don’t think it will be much different as far as diagnosing/fixing problems goes.
I haven’t worked with cache code in a while, but I recall its being much more complicated than that. First of all, there are different kinds of caches, such as the browser cache, server cache, and a proxy server (such as a CDN) cache… and many coded instructions that can affect how they behave, which may vary depending on both the browser and the kind of web server.
I’ve only worked directly with Apache servers, but IIS, NGINX, CloudFlare’s caches, etc, all behave somewhat differently and may overlap.
One set of instructions I recall coding (years ago) involved Apache code modules like mod cache, mod cache disk, etc. Instructions you specify for them might include things like fresh, stale, freshness lifetime, expiration date, conditional modification instructions, and so on. Very complicated stuff. All of those (and far more) variables, multiplied by the Firefox extensions I use for this plus the reload or shift-reload you mentioned… adds up to a hellishly complex situation that no simple statement can encompass. Mostly I’ve had to approach it empirically, through trial-and-error more than actually understanding what all the options are really going to result in.