Mobile app version of vmapp.org
Login or Join
Heady270

: How can I cause a browser to download a new copy of a web page when it thinks that its cached copy is still valid? Sometimes when I make small changes to a website, I notice that certain

@Heady270

Posted in: #Cache

Sometimes when I make small changes to a website, I notice that certain browsers are very stubborn about downloading the page again. Both F5 and CTRL-R are worthless and the only way to fix it is to go through the options and manually tell it to clear the cache. I've used PHP before to send a cache-flush header, but is there a simpler or better way?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Heady270

2 Comments

Sorted by latest first Latest Oldest Best

 

@Sent6035632

It depends on what's cached. If it's the main page then the only way to prevent caching is using the no cache HTTP header.

However keep in mind that JS and CSS files are also usually cached. One trick to invalidate them when they change used by many websites - including this - is appending a dummy number after the '?'. Everything after the '?' is ignored by the web server, but since the URL changes the browser always re-downloads it.

An example taken from this very page: sstatic.net/webmasters/all.css?v=ac775b7bd951. The "ac775b7bd951" comes from mercurial, the versioning system used. You can do something similar with svn (example: all.css?revision=123).

10% popularity Vote Up Vote Down


 

@Karen161

F5 is refresh using the cache. Ctrl-F5 will ignore the cache. I'm not certain, but it sounds like Ctrl-R is equivalent to F5 rather than Ctrl-F5?

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme