java-cef: How to Reload a Page Ignoring Cache?

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

java-cef: How to Reload a Page Ignoring Cache?

Postby user42 » Tue Mar 23, 2021 7:17 am

I have a Java application using a JCEF browser component, and I would like to refresh the page it is currently displaying while reloading all files freshly from the server without restoring any of them from the browser's cache.

Of couse, there's a method called reloadIgnoreCache() on CefBrowser (https://bitbucket.org/chromiumembedded/ ... a#lines-98). Invoking this method does in fact make most of the files be freshly reloaded. However, there will still be some files whose cache version will be used instead.

As an example, I have attached a screenshot showing the JCEF developer tools after reloadIgnoreCache() has been invoked on a CefBrowser instance displaying the website https://www.microsoft.com/. There's a file for which a maximum cache age of ten minutes has been specified (which hadn't yet elapsed at the time the file had been requested), and it has been restored from cache.

Now, if you check the "Disable Cache" option in the dev tools window and refresh the page by pressing F5, that file will always be reloaded from the server, no matter whether its cache interval has yet expired or not — in contrast to what happens when using reloadIgnoreCache().

So, how do I get that same behavior in code, that is reloading a page and completely ignoring cache (despite any response headers whatsoever)?
Attachments
screenshot.png
screenshot.png (224.52 KiB) Viewed 2041 times
user42
Newbie
 
Posts: 1
Joined: Tue Mar 23, 2021 5:41 am

Return to Support Forum

Who is online

Users browsing this forum: No registered users and 26 guests