Error: Bad value expires for attribute http-equiv on element meta

1

Good morning, I am passing the validator of W3C, and I would like to correct this error.

Gcs

Error: Bad value expires for attribute http-equiv on element meta.

From line 18, column 1; to line 18, column 43

panish"/>↩<meta http-equiv="expires" content="never">↩<meta
    
asked by Fernando Lopez 29.08.2016 в 18:42
source

2 answers

1

The expires value is not allowed in HTML5 for the <meta> tag and the http-equiv attribute, here you can see the specification: link

The only values allowed are:

  

'content-language', 'content-type', 'default-style', 'refresh' and 'set-cookie'

The solution is to send the field in the headings, which is defined here: link

An example is:

  

Expires: Thu, 01 Dec 1994 16:00:00 GMT

According to the documentation to send "never" as the expiration date, a date should be sent approximately one year after the HTTP response was sent , it is also recommended NOT to send dates after one year in the future.

    
answered by 29.08.2016 в 18:56
0

The allowed attributes for http-equiv are:

content-language

Content-Security-Policy

content-type

default-style

refresh

set-cookie

Source:

link

link

The case you are trying to use "expires" is a special case and converts to an HTTP header.

  

Extensions to the predefined set of policies may, under certain circumstances, be registered on the WHATWG Wiki PragmaExtensions page.

     

These extensions must use a name that is identical to an HTTP header registered in the Permanent Message Header Field Registry, and must have an identical behavior to the one described by that HTTP header.

According to the spec you must use one year after the date of the shipping and should always be a valid date RFC 1123 .

<meta http-equiv="expires" content="Mon, 29 Aug 2017 17:06:13 GMT">
    
answered by 29.08.2016 в 19:07