• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

servlet jpg server cache ?

 
Ranch Hand
Posts: 245
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
clear browser history and check once
 
Miran Cvenkel
Ranch Hand
Posts: 245
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 245
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ?
 
Marshal
Posts: 27450
88
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 245
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Marshal
Posts: 27450
88
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 245
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The a.jpg is reuploaded. Means, before was image of cow, now is image of apple.
 
Paul Clapham
Marshal
Posts: 27450
88
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Would you like to try a free sample? Today we are featuring tiny ads:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic