WidgetSet cache - Pragma: no-cache

Hello everybody,

We’re running a Vaadin application on JBoss 5.1 application server (Tomcat 5.5). I noticed lately that the widgetset (xxx.cache.html) is not cached at all on the client-side.

Though the server is sending some caching instruction like “max-age: 3600” … it does also send a “Pragma: no-cache” instruction:


Request Headers

Accept:text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4
Connection:keep-alive
Cookie:JSESSIONID=5FDA0F20EA613BFD1BDDEFA1888EDD2C
Host:sixd-dashboard.viagents.com
If-Modified-Since:Mon, 14 May 2012 07:54:42 GMT
Referer:http://sixd-dashboard.viagents.com/dashboard/tracking/VAADIN
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.168 Safari/535.19


Response Headers

Cache-Control:max-age: 3600
Connection:Keep-Alive
Content-Type:text/html; charset=UTF-8
Date:Mon, 14 May 2012 08:43:57 GMT
Expires:Thu, 01 Jan 1970 00:00:00 GMT
Last-Modified:Mon, 14 May 2012 08:43:57 GMT

Pragma:No-cache

Proxy-Connection:Keep-Alive
Server:Apache/2.2.3 (CentOS)
Transfer-Encoding:chunked
Via:1.1 NORAD
X-Powered-By:Servlet 2.5; JBoss-5.0/JBossWeb-2.1

So, my question: how could this happen? Are we missing any sort of important configuration on the server-side? Maybe inside the Vaadin application?
I switched the application from “debug-mode” to “produciton-mode”, but no change.

Also, typically the JBoss is proxied by an Apache webserver … but no matter whether I call the application via the proxy or whether I access the backend directly,
the result stays the same.

I found this post in the forum: https://vaadin.com/forum/-/message_boards/view_message/1174411, ie. tested to visit the Vaadin sampler, where the caching of the widgetset works just fine

Did anybody experience this behavior too and could provide a helping hand on this?

Please advise
Oliver

PS: As I just learned, this “Pragma: no-cache” is not set when the developer is deploying the solution to his local machine, and is doing local requests (Windows machine)

This is strange and seems to confirm that the “Pragma: no-cache” is not set by Vaadin but by the server. AbstractApplicationServlet.serveStaticResourcesInVAADIN() does not set the pragma for the static files it server. Check your server configuration and what happens to other similar static files in the VAADIN directory.

If you have a high-volume server with Apache as the front end anyway, you could also explicitly copy the static resources to Apache and serve them directly from there. The disadvantage of this is that you need to remember to update them whenever you change the Vaadin version, widgetset, themes etc. and application deployment gets a bit more complicated.