3

I am updating the HTML of a site to be HMTL5 compliant. The existing site has the following two meta http-equiv elements:

  • Cache-Control
  • Pragma

Are these two HTML5 compliant? If not, what should I replace these with in order to make my site HTML5 compliant?

I found this link that lists down the valid http-equiv pragmas:

http://www.w3.org/TR/html5/document-metadata.html#attr-meta-http-equiv

It does not include Cache-Control or Pragma in the list.

Thanks in advance.

Paul Sweatte
  • 24,148
  • 7
  • 127
  • 265
SNP
  • 78
  • 2
  • 10
  • 1
    Check this link http://stackoverflow.com/questions/6664542/html5-meta-tag-cache-control-no-longer-valid – Asons Oct 09 '15 at 07:58
  • @LGSon's comment above led me to this: http://www.html5rocks.com/en/tutorials/appcache/beginner/ (not posting it as an answer because too lazy to post a non-link-only answer, also because I think it's a bad idea to set cache-control in html) – slebetman Oct 09 '15 at 08:05
  • @slebetman Are you saying I'm to lazy to post a non-link answer? – Asons Oct 09 '15 at 08:07
  • @LGSon: No, I'm saying I am. – slebetman Oct 09 '15 at 08:10
  • @slebetman Hahaha ... okey, well I flagged it as duplicate and added the same post as a comment until it will be referred as duplicate – Asons Oct 09 '15 at 08:12

1 Answers1

3

Cache related pragmas are non-compliant:

Pragma directives corresponding to headers that affect the HTTP processing model (e.g. caching) must not be registered, as they would result in HTTP-level behaviour being different for user agents that implement HTML than for user agents that do not.

There is no alternative in HTML5.

Here are the relevant http-equiv pragmas for HTML5:

The http-equiv attribute is an enumerated attribute. The following table lists the keywords defined for this attribute. The states given in the first cell of the rows with keywords give the states to which those keywords map. Some of the keywords are non-conforming, as noted in the last column.

State                       Keyword                 Notes

Content Language            content-language        Non-conforming
Encoding declaration        content-type    
Default style               default-style   
Refresh                     refresh     
Cookie setter               set-cookie              Non-conforming
X-UA-Compatible             x-ua-compatible     
Content security policy     Content-Security-Policy     

References

Paul Sweatte
  • 24,148
  • 7
  • 127
  • 265