cache.html file is not cached with JBoss(Tomcat) and Internet Explorer 6-7

394 views
Skip to first unread message

pepgrifell

unread,
Nov 20, 2009, 12:25:54 PM11/20/09
to Google Web Toolkit
Hi,

I have 2 filters in my aplication (defined in web.xml):

- CacheFilter: to cache static files (*.cache.html,*.css, ...)
- GZIPFiler : to gzip cache.html file.

GZIPFilter works ok but cache filter , using JBoss and IE6-7 does not
caches my cache.html file.

I read that Tomcat adds Pragma: no-cache header to any resources in a
secure context. So, altough I add an expires header (1 year) to my
cache.html file, then Tomcat adds Pragma: no-cache header and the
cache.html file is not cached.

In this link http://forums.adobe.com/thread/95228 they explain how to
add another filter (ResponseHeaderFilter) to change the headers
(after tomcat has added Pragma: no-cache header)

<filter>
<filter-name>ResponseHeaderFilter</filter-name>
<filter-
class>com.nte.anthema.gwt.server.common.ResponseHeaderFilter</filter-
class>
<init-param>
<param-name>Cache-Control</param-name>
<param-value>max-age=3600</param-value>
</init-param>
<init-param>
<param-name>Pragma</param-name>
<param-value>public</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>ResponseHeaderFilter</filter-name>
<url-pattern>*.cache.html</url-pattern>
</filter-mapping>

But, the html.cache file is not cached neither.

Has anyone got a solution to this ?

Thanks !!


Yozons Support on Gmail

unread,
Nov 20, 2009, 2:15:53 PM11/20/09
to google-we...@googlegroups.com
For Tomcat, if you have this in your META-INF/context.html:

<Context debug="0">
        <Valve className="org.apache.catalina.authenticator.NonLoginAuthenticator"
                disableProxyCaching="false" />
</Context>

This will prevent it from doing the caching.  If you have any other type of Authenticator in use already, you can probably just add the disableProxyCaching="false" attribute to it.

pepgrifell

unread,
Nov 23, 2009, 6:04:50 AM11/23/09
to Google Web Toolkit

Hi,

the problem is that *.css,*.js and images are cached but the only file
that is not cached is my cache.html file ... The file is about 3MB and
each time the users enter in the application, this file is downladed.
The only different thing from cache.html file and the others
(css,js,images...) is that cache.html file is gzipped before sending
it to the client.

I tried to add :
<Context>
<Valve className="org.apache.catalina.authenticator.FormAuthenticator"
disableProxyCaching="false" />
</Context>

in META-INF/context.xml file (WAR) but it's not working either. (we
use JAAS. I tried with FormAuthenticator and SSLAuthenticator)


Any idea why cache.html file is not cached ?

Thanks !

buz...@gmail.com

unread,
Nov 23, 2009, 9:41:10 AM11/23/09
to Google Web Toolkit
Hi,

Please share your HTTP headers for cache.html.
Also check your GZIP filter if it is not overriding some of the
settings already set by cache filter.

Dmitry

pepgrifell

unread,
Nov 24, 2009, 4:50:02 AM11/24/09
to Google Web Toolkit
request headers:
*******************************************************************************************************************************************************
GET /AnthemaWeb/com.nte.anthema.gwt.AnthemaGWT/
3A139A4DB7E5BFE75C879FD9A4250603.cache.html HTTP/1.1
Accept: image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-
shockwave-flash, application/xaml+xml, application/vnd.ms-xpsdocument,
application/x-ms-xbap, application/x-ms-application, application/
vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Referer: https://localhost/AnthemaWeb/com.nte.anthema.gwt.AnthemaGWT/AnthemaGWT.jsp
Accept-Language: es
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/
4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30;
MDDR; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.1)
Accept-Encoding: gzip, deflate
Host: localhost
Connection: Keep-Alive
Cookie: x-auto-8=m%3Asize%7Cf%3A194;
JSESSIONID=82E0B4DCE5D822C0CAA7A764214FC97C
*******************************************************************************************************************************************************

Response headers:
*******************************************************************************************************************************************************
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Pragma: public
Cache-Control: max-age=3600
Expires: Wed, 24 Nov 2010 09:42:57 GMT
X-Powered-By: Servlet 2.4; JBoss-4.2.3.GA (build:
SVNTag=JBoss_4_2_3_GA date=200807181417)/JBossWeb-2.0
ETag: W/"7046511-1258999964000"
Last-Modified: Mon, 23 Nov 2009 18:12:44 GMT
Content-Encoding: gzip
Content-Type: text/html
Content-Length: 7046511
Date: Tue, 24 Nov 2009 09:42:56 GMT
*******************************************************************************************************************************************************


On 23 nov, 15:41, "buz...@gmail.com" <buz...@gmail.com> wrote:
> Hi,
>
> Please share your HTTP headers forcache.html.
> Also check your GZIP filter if it is not overriding some of the
> settings already set by cache filter.
>
> Dmitry
>
> On Nov 23, 1:04 pm, pepgrifell <pepgrif...@gmail.com> wrote:
>
>
>
> > Hi,
>
> > the problem is that *.css,*.js and images are cached but the only file
> > that is not cached is mycache.htmlfile ... The file is about 3MB and
> > each time the users enter in the application, this file is downladed.
> > The only different thing fromcache.htmlfile and the others
> > (css,js,images...) is thatcache.htmlfile is gzipped before sending
> > it to the client.
>
> > I tried to add :
> > <Context>
> > <Valve className="org.apache.catalina.authenticator.FormAuthenticator"
> > disableProxyCaching="false" />
> > </Context>
>
> > in META-INF/context.xml file (WAR) but it's not working either. (we
> > use JAAS. I tried with FormAuthenticator and SSLAuthenticator)
>
> > Any idea whycache.htmlfile is not cached ?
>
> > Thanks !
>
> > On 20 nov, 20:15, Yozons Support on Gmail <yoz...@gmail.com> wrote:
>
> > > For Tomcat, if you have this in your META-INF/context.html:
>
> > > <Context debug="0">
> > >         <Valve
> > > className="org.apache.catalina.authenticator.NonLoginAuthenticator"
> > >                 disableProxyCaching="false" />
> > > </Context>
>
> > > This will prevent it from doing the caching.  If you have any other type of
> > > Authenticator in use already, you can probably just add the
> > > disableProxyCaching="false" attribute to it.- Ocultar texto de la cita -
>
> - Mostrar texto de la cita -
Reply all
Reply to author
Forward
0 new messages