1

I have checked this thread.
Disable browser cache for entire ASP.NET website

And wondering if I can put the answer inside page_load ?

If not how do I disable the cache on for a single page?

Thanks!

Community
  • 1
  • 1
rlee923
  • 758
  • 3
  • 14
  • 28
  • For aspx pages, they are not cached by browser by default. Am I missing something here? – Russel Yang Oct 14 '10 at 23:59
  • I think they are cached... or am I missing something? The page actually has a meta tag like this. And the information typed on this page is cached . Is it something different? – rlee923 Oct 15 '10 at 00:14
  • Do you have server side cache? you can use fiddler or charles to see if browser request the resource from server side. – Russel Yang Oct 15 '10 at 20:04
  • Yes, I think the issue is the serverside, rather than client side. – rlee923 Oct 18 '10 at 07:29

1 Answers1

0

And wondering if I can put the answer inside page_load ?

Yes you can as long as you have not set same Header before.

At the end you can place them, and check if your page get the cache header by inspecting the headers on the browser (chrome and firefox have utilities for that)

Aristos
  • 66,005
  • 16
  • 114
  • 150
  • So I have to remove the headers And I can use the code ? – rlee923 Oct 18 '10 at 07:28
  • @rlee923 Yes, I think is better to add the cache to the header and not inside the html header code. In my pages I set the cache on every page (or one time on master page) – Aristos Oct 18 '10 at 09:39
  • Thanks a lot ! (15 char req) – rlee923 Oct 18 '10 at 23:34
  • Instead of answering "yes" it would be nice to have an answer with at lease 1 code example. – Mike Jan 06 '17 at 16:21
  • 1
    @Mike Happy New Year for 2017. The code that you say is here on the question link http://stackoverflow.com/questions/1160105/disable-browser-cache-for-entire-asp-net-website so I will not place probably to not anyone say that I copy paste the answer. – Aristos Jan 06 '17 at 19:52