You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Bello Martinez Sergio <SE...@televes.com> on 2006/01/16 20:41:40 UTC

Images caching

Hi all,
I have a web application in Tomcat 5.0 (standalone) that does image swapping
for some mouse events. 
My problem is that IE does a GET request everytime I change an image's src
atribute. No matter if I
preload all document images with imgX=new Image(); imgX.src = '...', the
browser always request the image
from the server when I put the mouse over an image. I've tried to change
browser cache settings, too.
Does anybody know how can I do to avoid this? I've read resin lets you
define things like '<cache-mapping url-pattern="*.gif" expires="60D"/>'
Is there a way to do this with Tomcat? I would like to avoid using Apache
for the moment.
Thanks a lot,

Sergio


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Images caching

Posted by Rob Gregory <Ro...@RosesGroup.co.uk>.
Hey Guys,

We had the exact same issue when last tested for performance and even thou
the image had not changed the webapp made a request back to the server to
check... I resolved this by setting headers on the images when they were
originally served up by Tomcat (using a servlet filter). I can post code
examples if needed.

Hope this helps.
Rob Gregory

-----Original Message-----
From: ALEX HYDE [mailto:alex.hyde@btinternet.com] 
Sent: 16 January 2006 23:38
To: Tomcat Users List
Subject: Re: Images caching

Hey Bello,

I'm fairly new to this but don't mind putting my two
pence worth in. 

I'm not that sure about the client side but I've heard
mention of something called Squid which can cache
static content quite well and would sit as a proxy in
front of Tomcat. 

Gluck

--- Bello Martinez  Sergio <SE...@televes.com> wrote:

> Hi all,
> I have a web application in Tomcat 5.0 (standalone)
> that does image swapping
> for some mouse events. 
> My problem is that IE does a GET request everytime I
> change an image's src
> atribute. No matter if I
> preload all document images with imgX=new Image();
> imgX.src = '...', the
> browser always request the image
> from the server when I put the mouse over an image.
> I've tried to change
> browser cache settings, too.
> Does anybody know how can I do to avoid this? I've
> read resin lets you
> define things like '<cache-mapping
> url-pattern="*.gif" expires="60D"/>'
> Is there a way to do this with Tomcat? I would like
> to avoid using Apache
> for the moment.
> Thanks a lot,
> 
> Sergio
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail:
> users-help@tomcat.apache.org
> 
> 



		
___________________________________________________________ 
To help you stay safe and secure online, we've developed the all new Yahoo!
Security Centre. http://uk.security.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Images caching

Posted by ALEX HYDE <al...@btinternet.com>.
Hey Bello,

I'm fairly new to this but don't mind putting my two
pence worth in. 

I'm not that sure about the client side but I've heard
mention of something called Squid which can cache
static content quite well and would sit as a proxy in
front of Tomcat. 

Gluck

--- Bello Martinez  Sergio <SE...@televes.com> wrote:

> Hi all,
> I have a web application in Tomcat 5.0 (standalone)
> that does image swapping
> for some mouse events. 
> My problem is that IE does a GET request everytime I
> change an image's src
> atribute. No matter if I
> preload all document images with imgX=new Image();
> imgX.src = '...', the
> browser always request the image
> from the server when I put the mouse over an image.
> I've tried to change
> browser cache settings, too.
> Does anybody know how can I do to avoid this? I've
> read resin lets you
> define things like '<cache-mapping
> url-pattern="*.gif" expires="60D"/>'
> Is there a way to do this with Tomcat? I would like
> to avoid using Apache
> for the moment.
> Thanks a lot,
> 
> Sergio
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail:
> users-help@tomcat.apache.org
> 
> 



		
___________________________________________________________ 
To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org