1

I have a web page with a few resources, I would like to set the caching to save everything for an hour but revalidate that nothing has changed in the server.

I have tried this:

<meta http-equiv="Cache-Control" content="public, max-age=3600, must-revalidate" />

but the resources do not get refreshed.

and when i use the W3c Markup Validation Service - https://validator.w3.org/

it says this:

Error: Bad value Cache-control for attribute http-equiv on element meta.

From line 1, column 815; to line 1, column 897:

any suggestions?

Liraz Shaka Amir
  • 587
  • 9
  • 26
  • 2
    What do you mean "it doesn't work"? Does the computer explode when trying to revalidate? Be specific. – Maya Jul 06 '18 at 21:49
  • Server headers take precedence over the HTML meta tags; your server is likely sending out its own cache-control header that's overriding what you're trying to do here. (In general most people seem to prefer to control this at the server level instead of using meta tags, because it's way too easy to accidentally override the meta tags.) – Daniel Beck Jul 06 '18 at 21:58
  • See https://stackoverflow.com/questions/49547/how-to-control-web-page-caching-across-all-browsers – Daniel Beck Jul 06 '18 at 21:59
  • it doesn't work means that when it won't check the server for new resources (such as images) when I change them. – Liraz Shaka Amir Jul 06 '18 at 22:14
  • already saw this: https://stackoverflow.com/questions/49547/how-to-control-web-page-caching-across-all-browsers it's not what i need – Liraz Shaka Amir Jul 13 '18 at 21:38

0 Answers0