aspose file tools*
The moose likes Servlets and the fly likes servlet jpg server cache ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "servlet jpg server cache ?" Watch "servlet jpg server cache ?" New topic
Author

servlet jpg server cache ?

Miran Cvenkel
Ranch Hand

Joined: Nov 23, 2010
Posts: 147
This code returns jpg image + some random number printed on it with Graphics2D (code for that cutted of to be shorter)

1.Click refresh in browser, all looks OK, each time same image with different randome number.
2.I replace image on that same location, saj a.jpg with a.jpg, of course second a.jpg having totaly different photo
3.Click refresh in browser --> first a.jpg shows up!, doh there is no such image on disk, the random number printed on it is changing as expected on each refresh.
4. I'm doing this in netbeans, 'finish debuger session'/'debug project' does not help.
5. restart net beans,'debug project', refresh brings up new image, from this point on the thing is same from point 2 onwards.

Any tip appreciated.



Searchable nature photo gallery: http://agrozoo.net/jsp/Galery.jsp?l2=en
vinnu kumar
Greenhorn

Joined: Sep 10, 2007
Posts: 12
clear browser history and check once
Miran Cvenkel
Ranch Hand

Joined: Nov 23, 2010
Posts: 147
Browser cache is not a problem.

Click refresh in browser, all looks OK, each time same image with different randome number

I can open another browser and same thing, the prob is on server.
Miran Cvenkel
Ranch Hand

Joined: Nov 23, 2010
Posts: 147
figured out where the problem is:



No matter how many times this is executed it always holds data on first image with that file name & path.

Any comments ?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18564
    
    8

There can only be one file with a given path and file name. So I don't understand what "first" means there.
Miran Cvenkel
Ranch Hand

Joined: Nov 23, 2010
Posts: 147
forisntance first was named A.jpg and contained photo of cow.
second is named A.jpg and contains photo of apple.
I'm getting photo of cow all the time, doh the image file already contains photo of apple.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18564
    
    8

So those "A.jpg" files are actually the same file in the same directory, just at different times?
Miran Cvenkel
Ranch Hand

Joined: Nov 23, 2010
Posts: 147
The a.jpg is reuploaded. Means, before was image of cow, now is image of apple.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18564
    
    8

Then it looks like maybe the IconImage class is caching images rather than reloading them. You could get around that by using a different file for each upload, instead of reusing the same one.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: servlet jpg server cache ?