Image caching problem when using unique user IDs to generate image filenames

Jeff Portwine jdport at VERITIME.COM
Thu Mar 3 09:08:24 EST 2005


There have been a couple of threads relating to this recently.    The bug
happens if you are running php as a module instead of as a CGI.   For some
people, including myself, the problem can be fixed by not pre-loading the
mapscript.dll or mapscript.so in the php ini, and instead adding the ld
mapscript.dll/.so command to your script.     This worked for me, i'm
running php as a module still and this fixed the image caching problem you
are talking about.   However, it doesn't fix it for everybody... the only
sure way to fix it is to run php as a CGI.

-Jeff

----- Original Message -----
From: "David Ratcliffe" <rati at POST.COM>
To: <MAPSERVER-USERS at LISTS.UMN.EDU>
Sent: Wednesday, March 02, 2005 8:38 PM
Subject: [UMN_MAPSERVER-USERS] Image caching problem when using unique user
IDs to generate image filenames


> While perhaps not specifically a problem with Mapserver itself, I'm hoping
> someone who uses Mapserver can help me....
>
> I'm running Mapserver 4.4.1 on Tomcat 5. I would like the service to
> recognize particular users by ID, so I've included the "id" field in my
> HTML pages so the mapserver application doesn't create new image files for
> the same user all the time, it replaces existing ones for that user
> instead.
>
> My problem lies with the caching mechanisms of the browsers I'm using to
> display the images (IE, Mozilla and Firefox). When user interaction
> warrants the generation of new images, the new images replace the existing
> ones with the same filename (per user). Unfortunately, the browser does
> not re-request/refresh the images since they have the same names. Instead,
> it uses cached versions, despite the fact I have Tomcat serving absolutely
> all content with HTTP headers that specify that the browser should not
> cache any of the content. I am certain the HTTP headers are correct and
> present.
>
> I have cleared the cache for all browsers, I have checked the HTTP headers
> to ensure they all contain the appropriate 'do not cache' information, and
> I am aware the problem goes away when I stop using unique user IDs (as new
> images are always generated with new filenames), but I want the unique
> user ID feature.
>
> Has anyone else encountered this problem? How can I go about ensuring that
> images are always re-requested from the server when using unique user IDs?
>



More information about the mapserver-users mailing list