cjohnson300
asked on
Force browser not to cache, or force refresh
I have a html page that uses window.open to open a pdf file in another window. The problem I am having is that if the pdf has changed, and the browser has opened it recently, the browser returns the cached copy and not the recently changed version.
How can I either force the browser not to ever cache the pdf, or force a refresh on window.open so that the browser goes back to the server to collect the new version of the pdf?
Many thanks in advance
How can I either force the browser not to ever cache the pdf, or force a refresh on window.open so that the browser goes back to the server to collect the new version of the pdf?
Many thanks in advance
Can you influence the PDF creation or the page displayed by the window.open?
ASKER
the pdf is created on the first page, say page1.asp and once it is created and saved to the server, i then open the pdf using the same page with the window.open.
So in answer to your question, I think that must be both
So in answer to your question, I think that must be both
Hi,
before sending any data use
<%
pStr = "private, no-cache, must-revalidate"
Response.ExpiresAbsolute = #2000-01-01#
Response.AddHeader "pragma", "no-cache"
Response.AddHeader "cache-control", pStr
%>
in the ASP file - must be enough.
before sending any data use
<%
pStr = "private, no-cache, must-revalidate"
Response.ExpiresAbsolute = #2000-01-01#
Response.AddHeader "pragma", "no-cache"
Response.AddHeader "cache-control", pStr
%>
in the ASP file - must be enough.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
no, but i have now and it seems to works great! I assume that works because the browser thinks each pdf is a different one because of the suffix on the end? Does your code allow for random numbers from 0 to 100?
function rand ( n ) {
return ( Math.floor ( Math.random ( ) * n + 1 ) );
}
rand(100); //random number between 1 and 100
return ( Math.floor ( Math.random ( ) * n + 1 ) );
}
rand(100); //random number between 1 and 100