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. C#
  4. HttpWebRequest (Caching) problem?

HttpWebRequest (Caching) problem?

Scheduled Pinned Locked Moved C#
questionhelptutorial
3 Posts 2 Posters 1 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.
  • T Offline
    T Offline
    Trapper Hell
    wrote on last edited by
    #1

    I have set up a simple application to connect to the internet and download the contents of a file from time to time, for example a file containing quotes that are to change on daily basis. This has been set up correctly - the connection is made (using HttpWebRequest and HttpWebResponse...) and the contents are downloaded :) . However, running the application more than once will than display the same contents that were first downloaded. This can go on from a few hours to a few days! :wtf: I don't know what is going on, but I believe that the program is accessing some cache from somewhere instead of downloading the stream once again. I need the program to download the stream from the internet every time it is running - and ignores any cache or whatever it is that is storing the stream data. What am I to do? :sigh:

    J 1 Reply Last reply
    0
    • T Trapper Hell

      I have set up a simple application to connect to the internet and download the contents of a file from time to time, for example a file containing quotes that are to change on daily basis. This has been set up correctly - the connection is made (using HttpWebRequest and HttpWebResponse...) and the contents are downloaded :) . However, running the application more than once will than display the same contents that were first downloaded. This can go on from a few hours to a few days! :wtf: I don't know what is going on, but I believe that the program is accessing some cache from somewhere instead of downloading the stream once again. I need the program to download the stream from the internet every time it is running - and ignores any cache or whatever it is that is storing the stream data. What am I to do? :sigh:

      J Offline
      J Offline
      Judah Gabriel Himango
      wrote on last edited by
      #2

      Change the CachePolicy[^] of the HttpWebRequest.

      Life, family, faith: Give me a visit. From my latest post: "How differently the psalmist saw it! How blessed -- how truly happy with real joy! -- is the man who delights in the Law of the Lord." Judah Himango

      T 1 Reply Last reply
      0
      • J Judah Gabriel Himango

        Change the CachePolicy[^] of the HttpWebRequest.

        Life, family, faith: Give me a visit. From my latest post: "How differently the psalmist saw it! How blessed -- how truly happy with real joy! -- is the man who delights in the Law of the Lord." Judah Himango

        T Offline
        T Offline
        Trapper Hell
        wrote on last edited by
        #3

        Thanks a lot pal. Just what I was looking for!

        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