Response.Expires = 0 Response.Expiresabsolute = Now() - 1 Response.AddHeader "pragma","no-cache" Response.AddHeader "cache-control","private" Response.CacheControl = "no-cache"
<cfheader name="expires" value="#now()#"> <cfheader name="pragma" value="no-cache"> <cfheader name="cache-control" value="no-cache, no-store, must-revalidate">
<meta http-equiv="expires" content="Mon, 06 Jan 1990 00:00:01 GMT">
<%
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>
Header('Cache-Control: no-cache');
Header('Pragma: no-cache');
Sources:
- ASP – http://support.microsoft.com/kb/311006/en-us
- PHP – http://www.php.net/manual/en/function.header.php
- ColdFusion – http://www.bpurcell.org/blog/index.cfm?entry=1075&mode=entry
- JSP – http://www.jguru.com/faq/view.jsp?EID=377&page=2
Originally Posted on August 21, 2013
Last Updated on October 26, 2015
Last Updated on October 26, 2015
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.