Bug 141803 - [WK2] Add more detailed diagnostic logging for measuring network cache efficacy
Summary: [WK2] Add more detailed diagnostic logging for measuring network cache efficacy
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-02-19 12:12 PST by Chris Dumez
Modified: 2015-02-20 14:26 PST (History)
3 users (show)

See Also:


Attachments
Patch (31.74 KB, patch)
2015-02-19 12:30 PST, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (33.47 KB, patch)
2015-02-20 13:24 PST, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2015-02-19 12:12:16 PST
Add more detailed diagnostic logging for measuring network cache efficacy.

We want to know the reason the network cache is being by-passed, why the network cache decided not to cache a response and why it cannot reuse a cache entry.

Radar: <rdar://problem/19632080>
Comment 1 Chris Dumez 2015-02-19 12:30:11 PST
Created attachment 246907 [details]
Patch
Comment 2 Antti Koivisto 2015-02-20 11:05:40 PST
Comment on attachment 246907 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=246907&action=review

> Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp:202
> +static bool canRetrieve(const WebCore::ResourceRequest& request, CacheBypassReason& reason)

Having both the bool return and the reason seems redundant. Why not just make this return a singe RetrieveDecision enum (or similar) that covers both the success and the failure cases?

Same comment for canStore.
Comment 3 Antti Koivisto 2015-02-20 11:34:10 PST
Comment on attachment 246907 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=246907&action=review

> Source/WebKit2/NetworkProcess/cache/NetworkCacheStatistics.h:63
> +enum class CacheBypassReason {
> +    None,
> +    NotHTTPFamily,
> +    UnsupportedHTTPMethod,
> +    IsConditionalRequest,
> +    IsReloadIgnoringCacheData
> +};
> +
> +enum class CacheStorageFailure {
> +    None,
> +    NotHTTPFamily,
> +    UnsupportedHTTPMethod,
> +    IsAttachment,
> +    CacheControlNoStore,
> +    UncacheableHTTPStatusCode
> +};
> +
> +enum class CachedEntryReuseFailure {
> +    None,
> +    VaryingHeaderMismatch,
> +    MissingValidatorFields,
> +    Other,
> +};

I think these should then move to NetworkCache scope.
Comment 4 Chris Dumez 2015-02-20 13:24:40 PST
Created attachment 246993 [details]
Patch
Comment 5 Antti Koivisto 2015-02-20 13:40:36 PST
Comment on attachment 246993 [details]
Patch

r=me
Comment 6 WebKit Commit Bot 2015-02-20 14:26:04 PST
Comment on attachment 246993 [details]
Patch

Clearing flags on attachment: 246993

Committed r180456: <http://trac.webkit.org/changeset/180456>
Comment 7 WebKit Commit Bot 2015-02-20 14:26:09 PST
All reviewed patches have been landed.  Closing bug.