Write soup cache to disk after each page load.
authorDaniel Carl <danielcarl@gmx.de>
Fri, 15 Apr 2016 11:08:29 +0000 (13:08 +0200)
committerDaniel Carl <danielcarl@gmx.de>
Fri, 15 Apr 2016 11:08:29 +0000 (13:08 +0200)
This allows new instances of vimb to pickup latest cache entries.

src/main.c

index 5317404..6dbc6f6 100644 (file)
@@ -811,6 +811,12 @@ static void webview_load_status_cb(WebKitWebView *view, GParamSpec *pspec)
             if (strncmp(uri, "about:", 6)) {
                 history_add(HISTORY_URL, uri, webkit_web_view_get_title(view));
             }
+#ifdef FEATURE_SOUP_CACHE
+            /* Make sure the caches are written to file to be picked up by new
+             * browser instance. */
+            soup_cache_flush(vb.config.soup_cache);
+            soup_cache_dump(vb.config.soup_cache);
+#endif
             break;
 
         case WEBKIT_LOAD_FAILED: