Solved

upload file caching problem

Posted on 2004-10-18
2
177 Views
Last Modified: 2010-04-01
the new upload picture file does not display until i refresh the page. I believe this is a caching problem. So i added the following statements to prevent browser caching. But it didn't work. Is this a caching problem or something else? If this is a caching problem, how can i solve it?

 <%
response.setHeader( "Cache-Control", "no-cache" );
response.setHeader( "Pragma", "no-cache" );
response.setIntHeader( "Expires", 0 );

%>
0
Comment
Question by:jeff1919
  • 2
2 Comments
 
LVL 2

Accepted Solution

by:
siliconeagle earned 250 total points
ID: 12348340
you can add a date to the end if the image url to prevent image caching e.g:-
<img src="img.gif?<%= (new Date()).getTime() %>" />

is it the old image you see, or just no image?
if it's no image have you closed the file after writing it, maybe the webserver cannot read the file as it's open for writing.
0
 
LVL 2

Expert Comment

by:siliconeagle
ID: 12349193
some more headers to try are:-


// always modified
response.setHeader( "Last-Modified",""+(new Date()));
 
// HTTP/1.1
response.setHeader( "Cache-Control","no-store, no-cache, must-revalidate");
response.setHeader("Cache-Control","post-check=0, pre-check=0");
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Short answer to this question: there is no effective WiFi manager in iOS devices as seen in Windows WiFi or Macbook OSx WiFi management, but this article will try and provide some amicable solutions to better suite your needs.
A Short Story about the Best File Recovery Software – Acronis True Image 2017
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now