3

I generally work with WordPress but just completed a project for a client that was a static HTML page consisting of 8 pages and ~2 images per page. Working with WordPress I would either use w3 total cachce, cloudflare, photon or a solution through wp engine.

I've been doing research and found a few solutions regarding meta tags, and manipulating an .htaccess file. The meta tag route, I read, is not a reasonable solution as it does not validate properly with HTML5. (this was specifically referring to setting up no cache, but same idea)

<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />   

Reference here: Using <meta> tags to turn off caching in all browsers?

I also read a little bit here: http://www.metatags.info/meta_http_equiv_cache_control

Using something like this:

<meta http-equiv="Cache-control" content="public">
<meta http-equiv="Cache-control" content="private">
<meta http-equiv="Cache-control" content="no-cache">
<meta http-equiv="Cache-control" content="no-store">

But I'm not sure how they actually work and which is the correct one. Can someone point me in the right direction? Thanks!

Community
  • 1
  • 1
EHerman
  • 1,852
  • 7
  • 32
  • 52
  • Maybe this will solve http://stackoverflow.com/questions/15228697/prevent-html5-page-from-caching-what-replaces-cache-control-pragmano-cache – Tony Oct 10 '13 at 00:02

1 Answers1

6

Step away from the <meta> tags. Default caching headers sent by the web server are, in most cases, already appropriate for a static web site. Unless you have some unusual requirements - which does not appear to be the case here - there should be no need to modify them.

  • 2
    Thank you for the response. I've chosen this as the correct response. I appreciate the time to explain that. – EHerman Oct 10 '13 at 14:02
  • Can you please explain how to store the static page in cache of client and update it whenever i made any changes to that page without using urlfingerprinting ? – Pawan lakhera Dec 13 '18 at 07:40