Search for a way to auto clear browser cache

Browser caching is becoming more and more of an issue.

I am wondering if there is a way to force a web page to reload everything when visited? This would be ideal during a development phase.

EDIT: https://chrome.google.com/webstore/detail/clear-cache/cppjkneekbjaeellbfkmgnhonkkjfpdn?hl=en

I do find I need to click the extension button a few times to fully clear the cache, but it works almost all the time.

I should have said that it needs ideally, to be independent of browser if possible.

The specific situation, that I experience over and over in an almost Groundhog Day way, is that I send someone a web site under development, to look at. I explain the whole cache thing and how to make sure they see the updates, and then they come back to me saying that they don’t see the updates or the site is “funny”. I could potentially narrow the cache clearing method to their OS/Browser.

That would require some sort of instruction in the URL, which I don’t think is possible.

If a dev site, the only real option, which I’ve used in the past to ensure the client is seeing exactly what I want them see, is to publish to a new folder… devsite.com/newsite-v1/… devsite.com/newsite-v2/ and so on.

Interesting answers on it here, as it seems not all browsers respect no-cache rules, and a few suggestions round it

1 Like

Since it’s a dev site you can add this to your htaccess file and it should disable caching. Just make sure you don’t put it on the production site.

# DISABLE CACHING
<IfModule mod_headers.c>
    Header set Cache-Control "no-cache, no-store, must-revalidate"
    Header set Pragma "no-cache"
    Header set Expires 0
</IfModule>

<FilesMatch "\.(css|flv|gif|htm|html|ico|jpe|jpeg|jpg|js|mp3|mp4|png|pdf|swf|txt)$">
    <IfModule mod_expires.c>
        ExpiresActive Off
    </IfModule>
    <IfModule mod_headers.c>
        FileETag None
        Header unset ETag
        Header unset Pragma
        Header unset Cache-Control
        Header unset Last-Modified
        Header set Pragma "no-cache"
        Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
        Header set Expires "Thu, 1 Jan 1970 00:00:00 GMT"
    </IfModule>
</FilesMatch>
3 Likes

I will try that. Thanks.

Open chrome in incognito mode. That will clear the cache always.

That’s ok if you are using Chrome, you know about Incognito mode and can copy and past a saved URL into the address bar. Many can’t do this and will end up in a Bing search, thinking that Incognito mode is some sort of Paedo Avoidance Technique.