I want to set the Expires
header for all image/*
and text/css
. I'm doing this in a Filter
. However:
- before calling
chain.doFilter(..)
the Content-type is not yet "realized" - after calling
chain.doFilter(..)
the Content-type is set, but so is content-length, which forbids adding new headers (at least in Tomcat implementation)
I can use the extensions of the requested resource, but since some of the css files are generated by richfaces by taking them from inside jar-files, the name of the file isn't x.css
, but is /xx/yy/zz.xcss/DATB/...
.
So, is there a way to get the Content-type before the response is committed.