aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes pragma caching impact on images Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "pragma caching impact on images" Watch "pragma caching impact on images" New topic
Author

pragma caching impact on images

Jhun Hoon
Greenhorn

Joined: Nov 19, 2001
Posts: 28
Hi, i've tried using these in response object :


I know that this will 'force' the browser to request the server again, skipping the cache for the associated page. But what i dont know is this :
Are the images contained in the page also get request all over again?

Actually i just want the page to be new .. but still uses the images in the cache .. downloading all images all over again could make the web app slow ...

Plz helppppppppppp
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18125
    
    8

The images are not "contained" in the page. Only links to the images are contained in the page. So the browser makes a separate request for each image. And those headers apply only to the request for which they were returned, not to any other images.

So if your server is not setting the Pragma and Cache-Control headers on the response that sends the images, the browser will not see those headers when it downloads the images.
Jhun Hoon
Greenhorn

Joined: Nov 19, 2001
Posts: 28
My old perception was that the images also got requested all over again, skipping the cache.
It all began in another case i had when i have to popup images in another window. The problem i had is that the browser still show the old image even when i'd replaced the old image in my app. So i tested the pragma and control-cache approach, and it worked, the browser 'appeared' to always load the newest images .. and thus my perception was formed

I just knew the other approaches for always fetching the newest images from server, like using dynamic parameter value in the image query string url, etc.

Maybe in my older case is that the browser got more intelligent about images after i put the pragma and control-cache in response header.

Thank you very much for the information ..
I'll just have to experiment more ..
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18125
    
    8

I just tested this particular situation last week. So I don't have a perception, I saw what actually happened. My browser displayed the cached versions of the images even though it was told not to cache the page linking to them.
Jhun Hoon
Greenhorn

Joined: Nov 19, 2001
Posts: 28
Thanks Mr.Paul !!
Exactly the point what we want right now ^__^
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: pragma caching impact on images
 
Similar Threads
problem with using session attributes
Disabling Back Button in a browser
refresh problem
Enable JSESSIONID in url - How?
logout issue