Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Disable Caching: SetNoCache vs SetCachability vs Expires vs AddHeader("pragma", "no-cache");

Disable Caching: SetNoCache vs SetCachability vs Expires vs AddHeader("pragma", "no-cache");

Scheduled Pinned Locked Moved ASP.NET
questionvisual-studioalgorithmshelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    Urs Enzler
    wrote on last edited by
    #1

    I'm a bit confused. Searching the web for a solution to disable caching, I found several answers to this question. Unfortunately, I found several different answers all containing a mix of - Response.Expires - Response.Cache.SetNoStore - Response.AddHeader("pragma", "no-cache"); - Response.Cache.SetCacheability(HttpCacheability.NoCache); And secondly the documentation in MSDN is not quite clear, what every method exactly does. Maybe someone can help me understand? Thanks in advance Urs

    -^-^-^-^-^- no risk no funk ................... please vote ------>

    G 1 Reply Last reply
    0
    • U Urs Enzler

      I'm a bit confused. Searching the web for a solution to disable caching, I found several answers to this question. Unfortunately, I found several different answers all containing a mix of - Response.Expires - Response.Cache.SetNoStore - Response.AddHeader("pragma", "no-cache"); - Response.Cache.SetCacheability(HttpCacheability.NoCache); And secondly the documentation in MSDN is not quite clear, what every method exactly does. Maybe someone can help me understand? Thanks in advance Urs

      -^-^-^-^-^- no risk no funk ................... please vote ------>

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      All that those commands do is to add properties to the http header of the page. Most examples is just a collection of everything ever found on the matter, setting the same properties over and over in different ways using different values overwriting each other. You just have to find out what headers you need, and set them. Maybe this is helpful: http://www.seoconsultants.com/articles/1000/cache-control.asp[^] The ultimate source (although a lot to read) on how caching works is of course the RFC: http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13[^]

      --- single minded; short sighted; long gone;

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups