Click here to Skip to main content
15,908,776 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HTML
meta http-equiv='cache-control' content='no-cache'>
meta http-equiv='expires' content='0'>
meta http-equiv='pragma' content='no-cache'>

C#
Response.AppendHeader("Cache-Control", "no-cache, no-store, must-revalidate"); 
Response.AppendHeader("Pragma", "no-cache"); 
Response.AppendHeader("Expires", "0");


We have Cache preventing coding which is not working on proxy browsers.How to fix this for opera and other proxy browsers
Posted

1 solution

XML
The Meta tags:
<meta http-equiv="Expires" CONTENT="0">
<meta http-equiv="Cache-Control" CONTENT="no-cache">
<meta http-equiv="Pragma" CONTENT="no-cache">

And the code:
    Response.ExpiresAbsolute = DateTime.Now
    Response.Expires = -1441
    Response.CacheControl = "no-cache"
    Response.AddHeader("Pragma", "no-cache")
    Response.AddHeader("Pragma", "no-store")
    Response.AddHeader("cache-control", "no-cache")
    Response.Cache.SetCacheability(HttpCacheability.NoCache)
    Response.Cache.SetNoServerCaching()
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900