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. General Programming
  3. .NET (Core and Framework)
  4. How to disable the browser cache in WebBrowser

How to disable the browser cache in WebBrowser

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharpwinformscomtutorialquestion
3 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.
  • R Offline
    R Offline
    Raaya1
    wrote on last edited by
    #1

    I am using The Windows Forms WebBrowser control in C#. I want to resynchronize or disable browser cache by customizing webBrowser. Needs to set the following flags: DLCTL_RESYNCHRONIZE or DLCTL_PRAGMA_NO_CACHE. The reference says that I need to implement IDispatch (referenced at http://msdn.microsoft.com/en-us/library/aa770041.aspx) I am not sure what interface of webBrowser control I need to use? Please send me if you have any info. Thanks, Ryan

    K 1 Reply Last reply
    0
    • R Raaya1

      I am using The Windows Forms WebBrowser control in C#. I want to resynchronize or disable browser cache by customizing webBrowser. Needs to set the following flags: DLCTL_RESYNCHRONIZE or DLCTL_PRAGMA_NO_CACHE. The reference says that I need to implement IDispatch (referenced at http://msdn.microsoft.com/en-us/library/aa770041.aspx) I am not sure what interface of webBrowser control I need to use? Please send me if you have any info. Thanks, Ryan

      K Offline
      K Offline
      Kumar Arun
      wrote on last edited by
      #2

      Please paste this code in page_load event Response.Expires = 0; Response.ExpiresAbsolute = DateTime.Now.AddDays(-1); Response.CacheControl = "no-cache"; Response.AddHeader("Pragma", "no-cache"); Response.AddHeader("cache-control", "private"); Let me know if you need more detail. Thanks, Arun

      Arun Kr

      R 1 Reply Last reply
      0
      • K Kumar Arun

        Please paste this code in page_load event Response.Expires = 0; Response.ExpiresAbsolute = DateTime.Now.AddDays(-1); Response.CacheControl = "no-cache"; Response.AddHeader("Pragma", "no-cache"); Response.AddHeader("cache-control", "private"); Let me know if you need more detail. Thanks, Arun

        Arun Kr

        R Offline
        R Offline
        Raaya1
        wrote on last edited by
        #3

        Thanks a lot, Arun. I am developing a flash application inside of webBrowser (that is in windows.forms). It seems that a page_load event and Response are used at the server side to clean cache. my webBrowser works at the client side. I used external WinInet library cleared the web browser cache. However, it does not work consistent. Is there a way to set these Pragma settings from client side? I am really appreciated your reply. -- Ryan

        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