0
<meta http-equiv="last-modified" content="Mon, 20 Jun 2022 21:13:42 GMT"/> 

What is wrong with the above meta tag that is rejected by validator.w3.org with "Bad value “last-modified” for attribute “http-equiv” on element “meta”.", how do I make it validate?

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
MiscellaneousUser
  • 2,915
  • 4
  • 25
  • 44
  • Lots of people throw arbitrary garbage into `` tags. Most browsers don't complain, but that doesn't mean it's valid HTML. The [`` tag](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta), formally speaking, accepts a very narrow set of keys, and anything diverging from that is not valid HTML. If you want to include `last-modified`, you can include it as a [data attribute](https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes) on some top-level tag or just put a comment in your HTML somewhere. – Silvio Mayolo Jun 20 '22 at 20:25
  • `http-equiv` is a bad joke, use real HTTP headers (note, in particular, that the point of last-modified is so a client can use an HTTP HEAD request to determine if there is a fresh version of the file, if you hide that information in the HTTP body then that won't work! – Quentin Jun 20 '22 at 20:25
  • OK, I understand then. I'll remove the tag and use the HTTP Header only then. Thanks for the comments and not just closing. https://www.w3schools.com/tags/att_meta_http_equiv.asp – MiscellaneousUser Jun 20 '22 at 20:36

0 Answers0