Results 1 to 2 of 2

Thread: Caching in ASP and ASP.NET

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2001
    Posts
    416

    Caching in ASP and ASP.NET

    Hi,

    In ASP, I always include the following lines in every page in order to force the page to reload in every visit:

    Response.Buffer = true
    Response.CacheControl = "no-cache"
    Response.AddHeader "Pragma", "no-cache"
    Response.Expires = -1

    Is it necessary to do the same thing in ASP.NET?
    I see that 'Buffer' is available as a property for 'DOCUMENT' in VS.NET, but not the others. Is there any standard way for this?

    Thx!!

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Caching in ASP and ASP.NET

    You can use that same code, or you can simply try this:

    VB Code:
    1. Response.Cache.SetCacheability(HttpCacheability.NoCache)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width