Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there HTML5 compliant alteratives to the http-equiv Cache-Control and Pragma directives?

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.

like image 244
SNP Avatar asked Dec 06 '25 03:12

SNP


1 Answers

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

  • HTML5 Semantics: Pragma Directives

  • HTML5 Semantics: Other Pragma Directives

like image 103
Paul Sweatte Avatar answered Dec 08 '25 02:12

Paul Sweatte



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!