How to reload without cache? #3923
Replies: 7 comments 2 replies
-
yes, must use CTRL-SHIFT-R to clear without cache, but I can't figure out how to do it in code, either, other than use javascript. |
Beta Was this translation helpful? Give feedback.
-
Could you give an example how you would reload it via javascript? My current experimentation is to send CTRL+SHIFT+R to the WebView2 window handle, not quite successful so far. |
Beta Was this translation helpful? Give feedback.
-
Well, it used to work by doing this:
I find that is no longer sufficient. It reloads the main document but not javascript or css files. The |
Beta Was this translation helpful? Give feedback.
-
We have now had 2 occasions where this feature would be beneficial. First occasion was an unintentional permanent redirect response from the server, and the second case was a corrupt js file. Both of these issues required either:
Please consider a method to "hard reload" the page programatically. |
Beta Was this translation helpful? Give feedback.
-
Something happened along those lines (since Jan 2022)? I also have a hard time here, to figure out how i can completely "re-open" a site, in WebView2. Since we have a system that generates CSS and JS, along with HTML and we have to "re-render" this, by refreshing the whole site in WebView2. The things i tried:
None of that helped. So i have no clue at the moment, how a WebView2 could do a completely fresh load of a website. PS: The only thing that works, is to open the browser tools in WebView2 and press CTRL+F5. |
Beta Was this translation helpful? Give feedback.
-
Additional note: I found 1 another "trick" to force a full reload of the site (including CSS and JS), by invalidating the cache:
The only other option was sending a CTRL+F5 KeyPress event to the WebView2 container. Maybe this helps someone coming here for the same questions. |
Beta Was this translation helpful? Give feedback.
-
Compromise solution:
|
Beta Was this translation helpful? Give feedback.
-
Currently the CoreWebView2.Reload method reloads the currently active page preserving the cache state. Is there a way to programmatically reload the page without keeping the cache?
Beta Was this translation helpful? Give feedback.
All reactions