Do not load HTML page from cache

Here, what I need to get, the page version should be the latest. This is a price list, I do not want prices from last week.

So, I got the code from all over the world on the Internet and pasted it into my header, here it is:

<meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="expires" content="0"> 

I don’t know if this is enough or what he is doing, but he should tell the browser:

  • Download page
  • Forget about the cache, it's too old, even if you hit reboot 10 times in a row. Download it again.

So the question is: is this correct? This is an HTML page only, no jQuery and PHP.

+4
source share
1 answer

Those meta tags have the http-equiv attribute because they are document-level placeholders for elements that should be in the HTTP response. Instead of sending requests for your bare resource, clients should send a “GET if not modified since X” request, and they should be correctly set in your header. Contact your host for a link on how to provide these “no cache” options.

See this exact duplicate of your question for more information, by the way.

In addition to the knowledge base, add “Prices up to XXXX” in the content of your page. This is a price list, so someone will print it out and think that it will still be a good price if you do not have an indicator.

+1
source

Source: https://habr.com/ru/post/1482294/


All Articles