kavinkumar kumar wrote:I am using glassfish as server and jsp for sqlserver connectivity .. i ve retieved images from DB to a specific location and try to update it in the page but oly the first time the image loads later the same images get loaded... TEll me how to use Etag and last modified to avoidcaching...
Guru Vijay wrote:
Are you retrieving the image from DATABASE and placing in a physical repository ???
kavinkumar Rajendran wrote:I tried cache control solutions but none worked.. For me my server s caching the script and img files..any Solution guys..
Daniel Val wrote:
kavinkumar Rajendran wrote:I tried cache control solutions but none worked.. For me my server s caching the script and img files..any Solution guys..
Hi,
The solution is as follows:
1. Not the jsp is cached - *.jsp url is never cached but the images. The images are the object of separate http requests
2. How you do it
instead of
you put
And generate instead of randomstuffhere some random string. The best for me worked with a java class called RandomGuid which is freely available on the internet.
This used to be a very good approach for the old mobile browser programming back in the days when phones were dumb and were caching everything. Be careful though as your browser sandbox will fill with various images - not that it would be a big issue.
D
kavinkumar Rajendran wrote:ll this work ??
<img src="<%=adress%>">
where
String adress="name.jpg?id=123abc";
kavinkumar Rajendran wrote:I dono how to use JSTL or EL
.. I Actually finished my entire project the oly problem s that i get the same images always..
If there s a way to break cache in JSTL or EL let me know.. I open to options guys...