webtier@glassfish.java.net

What is the best way to configure static resources cache for 3.1?

From: <forums_at_java.net>
Date: Tue, 5 Jul 2011 10:15:55 -0500 (CDT)

What is the best way to configure cache for static resources such as images,
js and css files, etc for Glassfish 3.1? With the default settings used
I see that my server returns lots of "304 Not Modified" responses but it is
still a request/response cycle and puts an extra wait for the client and a
little burdon for the server. I would like that after the first read of a
static file, browsers don't ask for it at all for an extended period of time.
I tried to use filters to set Cache-Control headers to the responses of the
static files, but it seems that this gets overwritten later at some stage. I
also suspect that the E-Tag header which is automatiacally put by GF can
impact the browser decision on whehter to use cache or ask the server for the
document again? I managed to get the things working using an Apache httpd
server in front of the GF, which was placing the correct headers and removing
the E-Tag, but I would like to know if this is achievable using GF only as
using apache https leads to a more complex configuration and problems on its
own?


--
[Message sent by forum member 'spg82']
View Post: http://forums.java.net/node/818791