Bug 137489 - [SOUP] [WK2] WebProcess and NetworkProcess initialization clears cache contents
Summary: [SOUP] [WK2] WebProcess and NetworkProcess initialization clears cache contents
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sergio Villar Senin
Depends on:
Reported: 2014-10-07 09:59 PDT by Sergio Villar Senin
Modified: 2014-10-12 02:32 PDT (History)
5 users (show)

See Also:

Patch (3.63 KB, patch)
2014-10-10 09:56 PDT, Sergio Villar Senin
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sergio Villar Senin 2014-10-07 09:59:39 PDT
The method NetworkProcess::platformInitializeNetworkProcess() creates the SoupCache object and performs the soup_cache_load() to load the index in memory. Loading the index has some side effects like deleting as much resources as needed to get the cache size under the max_size restriction. The problem is that unless soup_cache_set_max_size() is called before soup_cache_load(), the later will use the default cache max size (50Mb IIRC). 

Should you have a different max_size, it won't matter because the cache was already loaded and the resources exceeding the capacity already wiped.
Comment 1 Sergio Villar Senin 2014-10-10 09:44:21 PDT
Actually the same happens with the WebProcess initialization.
Comment 2 Sergio Villar Senin 2014-10-10 09:56:42 PDT
Created attachment 239633 [details]
Comment 3 Carlos Garcia Campos 2014-10-10 10:13:31 PDT
I guess resources will never be removed then? if load() is the only one doing that
Comment 4 Sergio Villar Senin 2014-10-12 01:56:21 PDT
(In reply to comment #3)
> I guess resources will never be removed then? if load() is the only one doing that

load() is not the one doing that. load() calls soup_cache_entry_insert() which is the one that makes room in the cache if there is not enough disk space to allocate the resource. soup_cache_entry_insert() is called for every single new resource. This means that old resources will be removed at any time once the cache is full.
Comment 5 WebKit Commit Bot 2014-10-12 02:32:12 PDT
Comment on attachment 239633 [details]

Clearing flags on attachment: 239633

Committed r174639: <http://trac.webkit.org/changeset/174639>
Comment 6 WebKit Commit Bot 2014-10-12 02:32:16 PDT
All reviewed patches have been landed.  Closing bug.