tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pid <...@pidster.com>
Subject Re: serving pre-compressed files
Date Thu, 09 Jun 2011 08:27:20 GMT
On 08/06/2011 16:03, Jesse Farinacci wrote:
> Greetings,
> 
> I'm using Tomcat 7.0.14 and IBM Java 6. As part of my web
> application's bundling mechanism (via Maven) I have the ability to
> pre-gzip compress static resources. I'd like Tomcat to detect that a
> request for /path/to/resource has /path/to/resource.gz available, and
> serve the gzip'd content instead, if the user agent supports it.
> 
> Is there anything like this available? If not, what suggestions do you
> have? Thanks,

Not quite the same, but similar, is the following:

If you're using Tomcat 7, you have Servlet 3 compatibility, which means
you can serve resources out of a specially* constructed jar.


p

* Put resources in: myresource.jar:/META-INF/resources and they will
appear as from the root of the webapp.

e.g.  /META-INF/resources/logo.gif -> /logo.gif


Mime
View raw message