New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 680731 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Feb 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: iOS
Pri: 2
Type: Bug



Sign in to add a comment

Provide mechanism to disable caching in Cronet iOS API

Project Member Reported by robgaunt@google.com, Jan 12 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36

Steps to reproduce the problem:
This problem relates to the Cronet iOS API.

I created an NSURLSessionConfiguration with URLCache = nil. According to the NSURLSessionConfiguration documentation, this should disable caching: https://developer.apple.com/reference/foundation/nsurlsessionconfiguration/1410148-urlcache?language=objc

However, when I install the Cronet handler using this session configuration, Cronet still writes files to the Library/Caches/Cronet directory.

What is the expected behavior?

What went wrong?
Cronet should respect the URLCache setting of NSURLSessionConfiguration. Or, if this is not technically feasible, there should be some other mechanism to disable caching on a per-session basis. (Or even a per-request basis, although this is a bit more awkward.)

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 55.0.2883.95  Channel: stable
OS Version: OS X 10.12.2
Flash Version:
 

Comment 1 by mef@chromium.org, Jan 12 2017

Cc: lilyhoughton@chromium.org kapishnikov@chromium.org mef@chromium.org
Components: -Blink>Internals Internals>Network>Library
Labels: -OS-Mac OS-iOS
Status: Available (was: Unconfirmed)
Currently [Cronet registerHttpProtocolHandler] disables NSURLCache, but Cronet cache type is determined prior to that, during [Cronet start].

I think explicit API to configure Cronet cache simular to CronetEngine.Builder.enableHttpCache() API on Android could be easier to implement and reason with.

Comment 2 by robgaunt@google.com, Jan 12 2017

An explicit API is fine with me. It would be good to document these sorts of gotchas somewhere since it may trip up other developers who just expect the existing session configuration to work identically with Cronet.

Any idea when this API could be added?

Comment 3 by mef@chromium.org, Jan 12 2017

Owner: lilyhoughton@chromium.org
Status: Assigned (was: Available)
Adding this API should be reasonably straight forward, assigning to Lily to estimate.
Project Member

Comment 4 by bugdroid1@chromium.org, Jan 19 2017

Status: Fixed (was: Assigned)

Comment 6 by mef@chromium.org, Jan 31 2017

Cc: robgaunt@google.com
Status: Assigned (was: Fixed)
We need to update this following an internal review:

- Rename HttpCacheType enum into CRNHTTPCacheType.
- Prefix HttpCacheType enum values with type name, e.g. CRNHTTPCacheTypeDisabled.
- Use NS_ENUM to define HttpCacheType enum.

See robgaunt for details.
Project Member

Comment 7 by bugdroid1@chromium.org, Feb 2 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/289293b5aeb0d4eed997ec0fb2f5088b0db66d92

commit 289293b5aeb0d4eed997ec0fb2f5088b0db66d92
Author: lilyhoughton <lilyhoughton@google.com>
Date: Thu Feb 02 19:15:51 2017

[Cronet] make HttpCacheType enum more comfortative to Obj-C style.

Add 3-letter class prefix (CRN), prefix enum values with enum name, and use NS_ENUM macro.

BUG= 680731 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_cronet_tester

Review-Url: https://codereview.chromium.org/2668353003
Cr-Commit-Position: refs/heads/master@{#447813}

[modify] https://crrev.com/289293b5aeb0d4eed997ec0fb2f5088b0db66d92/components/cronet/ios/Cronet.h
[modify] https://crrev.com/289293b5aeb0d4eed997ec0fb2f5088b0db66d92/components/cronet/ios/Cronet.mm
[modify] https://crrev.com/289293b5aeb0d4eed997ec0fb2f5088b0db66d92/components/cronet/ios/cronet_environment.mm

Comment 8 by mef@chromium.org, Feb 14 2017

Status: Fixed (was: Assigned)

Sign in to add a comment