• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Filter/jpg client image refresh.

 
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
Does nothing - as it should, image that is thumb does not get modified before served to client.
Hovewer, each time served, it reloads in browser, cache is ignored doh it is from same loc, same name, no changing link parameters.

How to prevent browser cache ignoratin ?

 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What headers are being sent in the response that contains the image?

Bill
 
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
It appears nothing is send by default.
Reading this: https://www.google.si/search?q=java+filter+cache&ie=utf-8&oe=utf-8&gws_rd=cr&ei=rSq7VoGPCOWB6ATA_7u4Dw# ....
 
William Brogden
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Note that there are HTTP header fields that the browser interprets.

Some code somewhere has got to build the response containing headers, which, among other things tell the browser is image data and whether or not it can be cached. These headers will be followed by the binary jpg image data.

Bill

 
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
according to this: http://www.onjava.com/pub/a/onjava/2004/03/03/filters.html



And appropriate filter code, like this



Img of firefox, where refresh/cache does not work, attached. Seems it receives max-age header, but that has no effect.
STASTUS: '200 OK' should be '304 Not modified'
Any idea on that ?
tmp.jpg
[Thumbnail for tmp.jpg]
 
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
Adding firefox screen shot: left image that gets cahed, right image that does not.
tmp1.jpg
[Thumbnail for tmp1.jpg]
 
Miran Cvenkel
Ranch Hand
Posts: 245
2
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Solution:

Code could be optimized, but it works. Just important things here.
If you write to client, Etag (UUID of image), you will get it back in form of request Header "If-None-Match"
Tested on FireFox.

 
Bartender
Posts: 1810
28
jQuery Netbeans IDE Eclipse IDE Firefox Browser MySQL Database Chrome Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Miran Cvenkel wrote:Solution:

Code could be optimized, but it works. Just important things here.
If you write to client, Etag (UUID of image), you will get it back in form of request Header "If-None-Match"


Very interesting fix. I have never used that header. I'm giving you a cow for coming back with the solution. It's bound to help someone else in the future.
 
reply
    Bookmark Topic Watch Topic
  • New Topic