Turn off browser cache

A

A.M

Hi,

How can I disable the end-user's browser cache inside the Page_Load event?

Thanks,
Alan
 
S

Steve C. Orr [MVP, MCSD]

This code should do the trick:

Response.Expires = 0
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-cache")
 
J

Joerg Jooss

Steve said:
This code should do the trick:

Response.Expires = 0
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-cache")

That is a myth.

OK, that's probably a harsh way to put it.

What it does is scare off HTTP 1.1 proxies and "upward-compatible" HTTP 1.0
proxies like squid. The browser itself can choose to ignore any of those
headers. Try Opera ;-)

Cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top