Caching

Vaadin seems to be doing some odd things with the xxx.cache.js file Cache-Control headers.

Date Mon, 11 Apr 2011 22:18:55 GMT
Server Apache/2.2.3 (CentOS)
Last-Modified Tue, 05 Apr 2011 16:54:02 GMT
Cache-Control max-age: 3600
Vary Accept-Encoding
Content-Encoding gzip
Content-Type text/html; charset=UTF-8

On a request for

https://blah.student.edu/wocka/VAADIN/widgetsets/blah.student.edu.wocka.wocka.widgetset.wockaWidgetset/98E53489175E9B6337206FFE0BC87D0D.cache.html

Presumably the xxx.cache.html is the portion that’s supposed to be cached on the client side.

First of all, is the syntax for the Cache-Control supposed to be

“Cache-Control max-age=3600”

With an equals sign rather than a colon, or does it matter?

Second, where is this value being set, and can it be reset in the application? It seems to be overriding some Apache httpd configurations that are attempting to set the Cache-Control themselves.

Also, it seems to not be respected in Firefox 4; it’s hitting the server with round trip and a http 200 http code on page reloads. I’d think that this should be cached with a fairly high max-age settings to prevent repeated downloads of the widget set. Or am I mistaken about this?

I think this is resolved now. Firebug was misleading me; it was showing the HTTP response code as 200, when in fact it was retrieving the data from disk cache and not hitting the network at all, as confirmed with wireshark.