dev@grizzly.java.net

HTTP Caching in grizzly file-cache

From: Vivek Pandey <Vivek.Pandey_at_Sun.COM>
Date: Wed, 09 Sep 2009 12:10:09 -0700

I use GlassFish v3 kernel/grizzly inside GlassFish gem. There is issue
dealing with Grizzly caching behavior. One of my user reports that HTTP
caching is not working. For each of the cached resources in the browser,
where an Apache or Mongrel server will send right caching headers and
ETag so that the client side cache can use it so that server can send
304 (not modified). GlassFish v3 server/Grizzly always sends 200 OK with
the static resource.

Is HTTP cache control behavior support in the file-cache feature? I just
checked out the code and dont think its fully supported. For example
there can be a case where a client can send ETag and If-modified-since
header, to which the server can send 304 indicating the cache is still
fresh. Maybe I missed something but can someone confirm if full HTTP
caching is going to be supported?

Also, Ruby support is achieved thru a implementation of GrizzlyAdapter.
Jeanfrancois indicated file-cache is going to work with it. I still am
not sure, how do I indicate Grizzly where the static resources are kept?
Will my current code work with it:

this.setHandleStaticResources(true);
this.setRootFolder(config.appRoot() + File.separator+"public");


If not then how to I tell Grizzly where to serve the files?

-vivek.