How to disable caching sitewide?

#1
Hi,
I would like to stop my site from being cached by browser. Under Apache, I would add following into .htaccess:
<IfModule mod_headers.c>
Header set Cache-Control "no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires 0
</IfModule>

Will this work with LiteSpeed server?

Thank you
 
#3
Thank you.

Site in question is a web interface to our internal order dispatch system and all of the content is dynamic. Caching, in fact , causes problems in this case.
 

serpent_driver

Well-Known Member
#4
If all sources are dynamic (static sources also??), then there is no need to disable the browser cache because such sources are not cached by design, but it depends on your application. For dynamically generated sources it makes sense to disable the browser cache, but not for static sources. You better should seperate browser cache handling like this.

Code:
<FilesMatch "(\.html|\.htm|\.php|\.HTML|\.HTM|\.PHP)$">
    Header set Cache-Control "max-age=0, private, no-cache, no-store, must-revalidate "
</FilesMatch>
 
#5
You can't disable caching, entirely. Your cache size is managed by Android, so if it gets too large, it will automatically remove older cached items.

You can reduce cache size by disabling prefetching:

Settings --> Data Usage --> disable prefetching

You could also use an external browser instead of the RiF internal browser Speed Test https://vidmate.bid/ , but that's really just moving the cache usage to a different place.
 
Last edited:
Top