Good afternoon, I need that results of my Servlet always cached by browser. Trying to put the same headers like http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js but the results still do not come from the browser cache (tested with FireBug).
My code:
response.setContentType("text/javascript");
response.setHeader("Last-Modified", "Mon, 15 Feb 2010 23:30:12 GMT");
response.setHeader("Date", "Tue, 28 Sep 2010 19:45:24 GMT");
response.setHeader("Expires", "Wed, 28 Sep 2021 19:45:24 GMT");
response.setHeader("Vary", "Accept-Encoding");
response.setHeader("X-Content-Type-Options", "nosniff");
response.setHeader("Cache-Control", "public, max-age=31536000");
response.setHeader("Age", "36");
My headers (firebug):
HTTP/1.1 200 OK
Content-Type: text/javascript; charset=UTF-8
Last-Modified: Mon, 15 Feb 2010 23:30:12 GMT
Date: Sun, 10 Oct 2010 14:40:49 GMT
Expires: Mon, 10 Oct 2011 14:40:49 GMT
Vary: Accept-Encoding
X-Content-Type-Options: nosniff
Server: sffe
Content-Encoding: gzip
Cache-Control: public, max-age=31536000
Content-Length: 46401
Age: 2
Googleapis headers:
HTTP/1.1 200 OK
Content-Type: text/javascript; charset=utf-8
Last-Modified: Mon, 15 Feb 2010 23:30:12 GMT
Expires: Wed, 28 Sep 2021 19:45:24 GMT
Vary: Accept-Encoding
X-Content-Type-Options: nosniff
Cache-Control: public, max-age=31536000
Age: 36
Content-Encoding: gzip
Date: Sun, 10 Oct 2010 14:32:06 GMT
Server: Google Frontend
Content-Length: 36838
All headers are the same, but with different order (even though the code - should not, apparently GAE reverses the order). In what may be the problem? Thanks.