Keith, thanks a lot for the comprehensive 'digging' to the source of the problem. I was almost sure it is related to somewhat strange behaviour of Javascript/AJAX in pmapper since that is used in pmapper 2 and if I remember well this problem just appeared for me on pmapper 2, not version 1. I was really wondering how any caching could appear when I completely delete the image object from the document and create it new with a new src, never considered a Mapserver bug...
I guess a quite easy way around this should be to define the name of the temporary image using PHP functions, something like session id plus some random code. Probably there is also a PHP function to create unique strings. Then use the function 'saveImage(tmpfilename)' instead of saveWebImage(). I will check in the next days for this. Armin Keith Boyle wrote: > Armin and list, > I've just found a solution to a problem I've been having while trying to > stand up a new pmapper derivative application. The problem was that > after using pmapper for a short time, the map would suddenly revert back > to the first map image of my session, and when I tried another action on > that map, I would get the second image (from when I had originally > started). This is similar to a thread back in March, though maybe not > exactly the same. > > In the end the problem is not with pmapper at all, so I'm afraid this > message might not belong on this list; however, it may be a problem that > others find while setting up pmapper, so please forgive me if this only > a little relevant. I though erring on the side of sharing > information/solutions would be better. > > Quickly, my new server was a risk: Debian Linux on an AMD64, Apache 2.2, > Mapserver 4.8 (PhpMapScript 4.6 I believe), PHP 5.1.2 with an > application built on an old version of pmapper(1.9.3). I may yet run > into problems later, but for now after the fix it looks pretty good. > > The problem ended up being the temporary name put out by > imgObj->saveImage() imgObj->saveWebImage() was being duplicated after > the current connection to the web server timed out (i.e. when the > 'keepalive' time expired). So if you keep making a series of requests, > the connection stays; however, if you pause long enough for that timer > to expire, then the duplicate images started. The time stamp part of the > temporary name was not changing, I fixed this in the source file > php_mapscript.c by using the time() function explicitly each time a file > is saved. > > There may be a way to fix this without recompiling, but I was not able > to find any. I'm sorry this post is so long, I hope this may be useful > to someone on the list (someday if not now :) Please let me know if you > want details, or if this is relevant enough for me to put in the Wiki. > > -Keith > > > ------------------------------------------------------------------------ > > _______________________________________________ > Pmapper-users mailing list > Pmapper-users at faunalia.it > http://faunalia.it/cgi-bin/mailman/listinfo/pmapper-users
