• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servlet jpg server cache ?

 
Miran Cvenkel
Ranch Hand
Posts: 202
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
vinnu kumar
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
clear browser history and check once
 
Miran Cvenkel
Ranch Hand
Posts: 202
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 202
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 21322
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 202
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 21322
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So those "A.jpg" files are actually the same file in the same directory, just at different times?
 
Miran Cvenkel
Ranch Hand
Posts: 202
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The a.jpg is reuploaded. Means, before was image of cow, now is image of apple.
 
Paul Clapham
Sheriff
Posts: 21322
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic