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

David Ratcliffe rati at POST.COM
Wed Mar 2 20:38:36 EST 2005


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