You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@roller.apache.org by Matt Raible <ma...@raibledesigns.com> on 2007/07/26 15:19:14 UTC

CompressionFilter for *.css and *.js

Howdy all,

I started playing with the new YSlow Firebug extension this morning.

>From the report on my site (I got an F), I noticed that CSS and JS
aren't gzipped. What do you think about adding the following to
web.xml by default?

<filter-mapping>
    <filter-name>CompressionFilter</filter-name>
    <url-pattern>*.css</url-pattern>
</filter-mapping>
<filter-mapping>
    <filter-name>CompressionFilter</filter-name>
    <url-pattern>*.js</url-pattern>
</filter-mapping>

Strangly enough, even after adding these - I still get an F saying
that my CSS and JS isn't compressed.

Other F items:

1. Use a CDN (unlikely I'll do this)
2. Add an Expires header (css, js and images - not sure if this is a
Roller issue)
3. Put CSS at the top (7 external stylesheets were found outside the
document HEAD). AFAICT, my CSS is at the top.
4. Configure ETags. I'm not sure why I got an F here because it says
"these components have an ETag" and then it goes on to list a bunch.
I'd expect the opposite - these components *don't* have an etag.

Any pointers to fix these things would be great.

Matt

-- 
http://raibledesigns.com