HTML5 meta Validation

Jesper Møller picture Jesper Møller · Mar 11, 2012 · Viewed 26.1k times · Source

Im trying to make my first HTML5 page but i simply cant get it to validate W3C keeps telling me that i have some errors i my meta tags.

the page in question is http://www.jmphoto.dk/otus/index.html (its an old HTML4 page that i try to use as base/redeo as HTML 5)

I cant find anny solution to get the following metatags to validate or find anny substitutes for them that will validate

<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<meta last-modified="Thu, 14 Apr 2011 12:17:27 GMT" />
<meta name="distribution" content="Global" />
<meta name="copyright" content="(c) 2012 OTUS" />

I have used most of the weekend trying to find a solution on the net but with no luck so I realy hope somebody smart can help me with this.

Answer

Alohci picture Alohci · Mar 11, 2012

OK, let's take the easy one first:

<meta last-modified="Thu, 14 Apr 2011 12:17:27 GMT" />

last-modified is not and has never been a valid attribute of the meta element. Not sure what is intended here.

<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="Expires" content="0" />

Putting caching instructions into meta tags is not a good idea, because although browsers may read them, proxies won't. For that reason, they are invalid and you should send caching instructions as real HTTP headers.

<meta name="distribution" content="Global" />
<meta name="copyright" content="(c) 2012 OTUS" />

Neither distribution nor copyright are recognized values for the name attribute of the meta element. Valid names are described at https://w3c.github.io/html/document-metadata.html#standard-metadata-names and http://wiki.whatwg.org/wiki/MetaExtensions.

I recommend dcterms.audience instead of distribution and dcterms.rights dcterms.rightsHolder instead of copyright.