Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bad value cache-control for attribute http-equiv on element meta

Tags:

html

I dont want my HTML5 pages to be cached , so i am using these tags under my HTML file

<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<script src="js/jquery-1.10.2.min.js"></script>

</head>

When i validated these with http://validator.w3.org/check ,

its saying as

Bad value cache-control for attribute http-equiv on element meta.

<meta http-equiv="cache-control" content="max-age=0" />

Bad value cache-control for attribute http-equiv on element meta.

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

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

<meta http-equiv="expires" content="0" />

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

<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />

Bad value pragma for attribute http-equiv on element meta.

<meta http-equiv="pragma" content="no-cache" />

Could you please let me know how to resolve this ??

like image 301
Pawan Avatar asked Jul 08 '15 11:07

Pawan


People also ask

What is meta equiv cache-control?

Meta equiv cache-control < Meta HTTP-EQUIV = "Cache-Control" The meta cache control tag allows Web publishers to define how pages should be handled by caches. They include directives to declare what should be cacheable, what may be stored by caches, modifications of the expiration mechanism, and re-validation and reload controls.

Does http-equiv expire on element meta?

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

Is http-equiv a bad value?

Bad value “cache-control” for attribute “http-equiv” on element “meta”. The value cache-control is no longer a valid pragma directive. A better alternative is defining cache-control as an HTTP header.

Why HTML5 doesn't support http-equiv attribute for meta property?

HTML5 has very small set of values available for http-equiv attribute for meta property. It's not that you can take any possible HTTP header and use it this way. Although browser may and support many non-standard values, it's simply non spec-conformant.


1 Answers

HTML5 has very small set of values available for http-equiv attribute for meta property. It's not that you can take any possible HTTP header and use it this way. Although browser may and support many non-standard values, it's simply non spec-conformant.

Information here: http://www.w3.org/TR/html5/document-metadata.html#standard-metadata-names in p. 4.2.5.3 Pragma directives.

What you can probably do is - depending on used server technology - add those headers to HTTP response. How - this depends on whether your page is dynamically generated or is a static file. In the second case it depends on server software capabilities.

like image 145
Kuba Wyrostek Avatar answered Nov 25 '22 19:11

Kuba Wyrostek