dev@glassfish.java.net

Re: expires-header valve

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Wed, 09 Jan 2008 18:29:51 -0500

Salut,

w.rittmeyer wrote:
> Jeanfrancois Arcand wrote:
>> Hi,
>>
>> w.rittmeyer wrote:

>>> Hello,
>>>
>>> given the recommendations of Yahoo's Steve Sourders on website
>>> performance I've been looking for a way to add expires headers to
>>> images and css-files that are delivered by glassfish.
>>>
>>> Since I haven't been able to find anything I think a Valve might be
>>> the way to go. Attribute would provide information about the amount
>>> of time to add to the current time and about which content-type
>>> elements to consider.
>>>
>>> Any thought about that?
>>
>> A Valve will works, but have you think about a Filter defined in
>> ${glassfish.home}/domains/domain1/config/default-web.xml, which will
>> be injected to any web application deployed under GlassFish. This way
>> you can reuse your filter in other app server (hopefully not, but just
>> in case).
>>
>> But for sure a Valve will works fine :-)
>>
>
> Well, granted, I haven't thought about this. Giving it some thoughts
> though, I am not so sure about it yet.
>
> Having been a long time Tomcat user I would consider Valves more
> flexible - though of course more app-server dependent - compared to the
> default-web.xml approach.
>
> The default-web.xml configures the behaviour for all webapps of this
> domain. A Valve though is configurable in the Tomcat world for Engines,
> Hosts and Contexts respectively. In GF at least for virtual servers.
> Though I am not sure about Valves for web-modules and http-listeners in
> Glassfish.

For GlassFish[1], it will work at the virtual-server and web-module
level (only the Engine level is not supported...but if you really needs
it, I can certainly look how to do it).

>
> Considering this I think using a Valve would be more fine-grained than
> the default-web.xml while still coarser than a filter for each web-app.
>
>
> But I will give it some more thoughts.

Let us know which solution you picked :-)

A+

-- Jeanfrancois

[1]
http://weblogs.java.net/blog/jfarcand/archive/2006/09/extending_glass.html

>
> Thanks,
>
> Wolfram Rittmeyer
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>