-3

Is C# Webbrowser keeping cache somewhere? And if so, how can I disable it? All the information I found about the subject is from 2009 and outdated.

My problem is that the Webbrowser at somepoint stops loading new content while browsing back to the same website. Instead it's repeating what it had already shown. When restarting the windows forms app it is loading new content.

Thanks!

Bishok
  • 17
  • 2
  • 1
    The server should tell the browser not to cache. Doesn't sound like a programming question. What have you tried? – Dennis Kuypers Aug 25 '17 at 22:56
  • Does https://stackoverflow.com/questions/3421144/how-to-disable-caching-in-the-net-webbrowser-control or https://stackoverflow.com/questions/1276619/caching-and-the-webbrowser-control-in-net help? – mjwills Aug 25 '17 at 22:56
  • It sounds like what i'm looking for but the app crashes as soon as i try it – Bishok Aug 25 '17 at 23:03
  • `but the app crashes as soon as i try it` As soon as you try **what**? – mjwills Aug 25 '17 at 23:07
  • webBrowser1.Refresh(WebBrowserRefreshOption.Completely); – Bishok Aug 25 '17 at 23:57
  • Can you show a screenshot of the app crashing when you run that line? – mjwills Aug 26 '17 at 00:55
  • It looks ok after the refresh, then i try starting a thread and it stops responding – Bishok Aug 26 '17 at 09:39
  • It crashes because the thread starts before the page finished loading, how can I check if the page is ready? I need something like this event listener `private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)` – Bishok Aug 26 '17 at 10:48

1 Answers1

0

Using Application.Restart(); Solved my problem

Bishok
  • 17
  • 2