Prevent pages from caching


/ Published in: ASP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <%
  2. Response.Expires = -1
  3. Response.Expiresabsolute = Now() - 1
  4. Response.AddHeader "pragma","no-cache"
  5. Response.AddHeader "cache-control","private"
  6. Response.CacheControl = "no-cache"
  7. %>
  8.  
  9. 'Or if thats too long winded then
  10.  
  11. <%
  12. Response.Expires = -1000
  13. %>
  14.  
  15. 'Abbreviated version (as per http://www.devx.com/vb2themax/Tip/18635)
  16. <%
  17. Response.CacheControl = "no-cache"
  18. Response.AddHeader "Pragma", "no-cache"
  19. Response.Expires = -1
  20. %>

URL: http://www.codefixer.com/tutorials/stop_caching.asp

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.