Pawan
Pawan

Reputation: 32321

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

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 ??

Upvotes: 10

Views: 17464

Answers (1)

Kuba Wyrostek
Kuba Wyrostek

Reputation: 6221

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.

Upvotes: 8

Related Questions