WebClient.DownloadData without cache

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default WebClient.DownloadData without cache

    I am using WebClient to download a text file from the net every 2 minutes.
    The problem is that I think I am reading the file from cache since when the
    file is change I still get the old file.
    Here is my code:
    Dim myWebClient As New WebClient()
    Dim responseArray As Byte() = myWebClient.DownloadData(szURL)

    How can I tell WebClient not to use cache ?

    Thanks in advance
    [email]ra294@hotmail.com[/email]





    YA Guest

  2. Similar Questions and Discussions

    1. Webclient w/ Proxy
      I have a WebClient.OpenRead that is timing out on some client machines. I believe the problem may be Proxy settings on the client machine. How...
    2. webclient.downloadfile
      I've been toying with an asp.net diretory browser and have been trying to use system.net.webclient.downloadfile as a means to download files from...
    3. Webclient.DownloadData() behind a firewall
      Hello, I'm using webclient.downloadData to scrape HTML from a website and was wondering if anyone has experienced any problems using this class...
    4. CookieContainer with WebClient
      Any help appreciated ... I am trying to connect to a site that requires authentication through cookies, and be able to navigate through several...
    5. WebClient Problem
      hi, i using WebClient to get the website. like string URL = "http://127.0.0.1/index.htm"; WebClient client = new WebClient(); Stream data =...
  3. #2

    Default Re: WebClient.DownloadData without cache

    Two things to try:

    1) Server cache control:
    ..asp page instead of .txt file in your url, .asp includes anti-caching headers ahead of the text file content read from the text
    file. see FileSystemObject in ASP to read the file content.

    2) make browser think it's a new url:
    append "?r=" & rnd * 999999 to the url of the txt file. The web server won't care about the trailing stuff but the browser thinks
    it's gonna get a new result and will fetch it. This syntax may not be perfect but you get the idea that a constantly changing
    QueryString portion of the URL will make browser keep pulling from the server.

    Chris Langsenkamp
    [url]http://chat.cleverchat.net/[/url]

    ----- Original Message -----
    "YA" <ra294@hotmail.com> wrote in message news:%23gRbWFKYDHA.656@tk2msftngp13.phx.gbl...
    I am using WebClient to download a text file from the net every 2 minutes.
    The problem is that I think I am reading the file from cache since when the
    file is change I still get the old file.
    Here is my code:
    Dim myWebClient As New WebClient()
    Dim responseArray As Byte() = myWebClient.DownloadData(szURL)

    How can I tell WebClient not to use cache ?

    Thanks in advance
    [email]ra294@hotmail.com[/email]






    Chris Langsenkamp Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139