Reputation: 10812
I have a simple html page which starts like this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="Cache-Control" content="public, must-revalidate">
<meta http-equiv="Cache-Control" content="max-age=88000" />
<script type="text/javascript" src="/js/index.js"></script>
....
However, when I check index.js
file in FF web console, I see Cache-Control: "max-age=0"
. Why is that and how can I fix it? Thanks!
Upvotes: 0
Views: 130
Reputation: 201628
There is no reason to expect a meta
tag in an HTML file to affect the HTTP headers sent for a JavaScript file that it refers to (or even the HTTP headers sent for the HTML file itself, for that matter).
The HTTP headers are set by the web server (or, more generally, HTTP server) software in use, possibly as affected by system-wide or directory-wide settings on the server. Long ago, the idea was that certain meta
tags might affect the HTTP headers for the HTML document itself, but this was generally not implemented in servers. Instead, browsers may use some meta
tags and act as if corresponding HTTP headers had been sent, but a) this only applies to the HTML document itself, if at all and b) it cannot be seen by tools that inspect the HTTP headers actually sent.
Upvotes: 2