Bug 69705
Summary: | [Soup] The Soup backend should communicate per-request cache preferences to the SoupCache | ||
---|---|---|---|
Product: | WebKit | Reporter: | Martin Robinson <mrobinson> |
Component: | WebKitGTK | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED WONTFIX | ||
Severity: | Normal | CC: | danw, mcatanzaro, svillar |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Martin Robinson
Each request from WebKit land has a cache policy. The possible cache policies are defined in ResourceRequestBase.h. They are:
enum ResourceRequestCachePolicy {
UseProtocolCachePolicy, // normal load
ReloadIgnoringCacheData, // reload
ReturnCacheDataElseLoad, // back/forward or encoding change - allow stale data
ReturnCacheDataDontLoad // results of a post - allow stale data and only use cache
};
These map directly to NSURLRequestCachePolicy from Cocoa land: http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSURLRequest_Class/Reference/Reference.html
In practical terms, this means that when a user in Epiphany holds shift and clicks the reload button, not only will the request skip in the in-memory cache, it will also skip the disk cache.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Martin Robinson
This requires changes to the SoupCache in libsoup. My initial idea for this API would be something like this: soup_cache_set_message_cache_policy(msg, SOUP_CACHE_POLICY_IGNORE_CACHE);
The policy could be stored as a piece of data attached to the message or the SoupCache could keep an internal table of policies.
Martin Robinson
The cache policy values also suggest that other disk cache implementations cache results of POST. Is this unusual? SoupCache only seems to cache GET requests.
Dan Winship
(In reply to comment #1)
> This requires changes to the SoupCache in libsoup. My initial idea for this API would be something like this: soup_cache_set_message_cache_policy(msg, SOUP_CACHE_POLICY_IGNORE_CACHE);
I'd say soup_message_set_cache_policy(msg, policy) (and get_cache_policy(), and a gobject property)
Martin Robinson
(In reply to comment #3)
> (In reply to comment #1)
> > This requires changes to the SoupCache in libsoup. My initial idea for this API would be something like this: soup_cache_set_message_cache_policy(msg, SOUP_CACHE_POLICY_IGNORE_CACHE);
>
> I'd say soup_message_set_cache_policy(msg, policy) (and get_cache_policy(), and a gobject property)
I prefer your approach immensely, because it allows third-party features to access the property.
Michael Catanzaro
Obsolete, soup cache is only used by EFL nowadays, and we should change that.