E
E
Error 5022018-09-03 20:15:32
Apache HTTP Server
Error 502, 2018-09-03 20:15:32

Is it possible to prevent the browser from caching all site files?

With the help of meta tags, caching of the HTML document was prohibited, but CSS files and other media rubbish are still cached in browsers of all stripes. Now the site is being finalized, but at the same time it is in the public domain and this often bothers me and not only me. I have to clear browser caches every time. Therefore, such an opportunity is of interest, at least temporarily disable caching with some gadgets on the server side.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
T
ThunderCat, 2018-09-03
@NullByte

As I understand it, you have a content versioning problem, that is, new scripts with the same name are not loaded? The correct approach is to add the version tag as a get parameter to scripts until you've completed it to a normal state. Like this:

<link rel="stylesheet" href="https://somecss.com/some.css?v12.3">

A
Alexander Taratin, 2018-09-03
@Taraflex

Header set Surrogate-Control "no-store"
Header set Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate"
Header set Pragma "no-cache"
Header set Expires "0"

Y
Yaroslav Sivakov, 2018-09-04
@yar3333

https://stackoverflow.com/questions/11532636/how-t...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question