Solved

upload file caching problem

Posted on 2004-10-18
2
179 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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Problem with Pie chart in Jsp 20 215
web service Rest Client creation 4 87
iterator example remove 8 74
JavaScript parse form with colon separated values 2 77
Knowing where your website is hosted is as important as the features you receive, the monthly fee, and the support you receive. Due diligence should be done when choosing your next hosting provider.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

832 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