Using cache with QNetworkAccessManager in QWebEngine
So. I've found this post http://www.qtcentre.org/threads/4626...kAccessManager
And looks like it doesn't work this way in QWebEngine. When I'm trying to load my programm in QWebKit, it shows cached page. But when I'm using QWebEngine, it shows regular chromium's "No internet connection" page. How should I change code in order for it to work in QWebEngine?
Thanks for your help!
Re: Using cache with QNetworkAccessManager in QWebEngine
QWebEngine doesn't use QNetworkAccessManager, the network handling is part of the web process which is the provided by the Chromium engine code.
It looks like the QWebEngineProfile has cache settings though.
Accessible through the view's QWebEnginePage.
Cheers,
_
Re: Using cache with QNetworkAccessManager in QWebEngine
Still can't understand how to remake it, so now it would cache and load cached page...
Added after 6 minutes:
All I need to know is - how to save and load cache in QWebEngine?
Re: Using cache with QNetworkAccessManager in QWebEngine
So if you set a file based cache type (which should be the default according to documentation), does QWebEngine not save anything?
Maybe try setting the cache path and see if that directory gets any files?
Maybe you need to set the http cache size.
Cheers,
_
Re: Using cache with QNetworkAccessManager in QWebEngine
The path is set. Size is also set. But it just shows "No internet connection". But in QWebKit it works the way it's supposed to. It would be much easier if there was some kind of caching example in QWebEngine
Added after 4 minutes:
I've just created a simple "Hello!" html page and tried to open it offline through my program. It still showed me "No internet connection", instead of showing simple "Hello!"
Re: Using cache with QNetworkAccessManager in QWebEngine
So the cache is only used when it could get the content from the actual server.
Maybe you need to set a request interceptor that, when no connection is available, redirects to the local file.
Cheers,
_