Clear caches on book load

This commit is contained in:
Kovid Goyal 2019-11-10 13:06:45 +05:30
parent 390c83bf3d
commit 07d5f721d4
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 4 additions and 0 deletions

View File

@ -372,6 +372,7 @@ class EbookViewer(MainWindow):
def load_finished(self, ok, data): def load_finished(self, ok, data):
open_at, self.pending_open_at = self.pending_open_at, None open_at, self.pending_open_at = self.pending_open_at, None
self.web_view.clear_caches()
if not ok: if not ok:
self.setWindowTitle(self.base_window_title) self.setWindowTitle(self.base_window_title)
tb = data['tb'].strip() tb = data['tb'].strip()

View File

@ -607,6 +607,9 @@ class WebView(RestartingWebEngineView):
def clear_history(self): def clear_history(self):
self._page.history().clear() self._page.history().clear()
def clear_caches(self):
self._page.profile().clearHttpCache()
def trigger_shortcut(self, which): def trigger_shortcut(self, which):
self.execute_when_ready('trigger_shortcut', which) self.execute_when_ready('trigger_shortcut', which)