Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert AsyncDiskBasedCache. #366

Merged
merged 1 commit into from
Sep 28, 2020
Merged

Revert AsyncDiskBasedCache. #366

merged 1 commit into from
Sep 28, 2020

Conversation

jpd236
Copy link
Collaborator

@jpd236 jpd236 commented Sep 26, 2020

The current implementation is not thread-safe, and making it thread-safe while
retaining an Asynchronous interface and allowing parallel reads would introduce
significant complexity. It is also limited to Android O+ which limits its value
at the moment.

For now, we can rely on either:

  • AsyncRequestQueue's fallback support for regular Cache, which uses the blocking
    executor to perform reads. This is functional, but does make heavier use of the
    blocking executor than is ideal, and also does not currently permit parallel
    reads, although this could be added later as an improvement to DiskBasedCache.

  • Cronet's own HTTP cache (although at the moment, we call disableCache(); we can
    make this configurable).

See #181

The current implementation is not thread-safe, and making it thread-safe while
retaining an Asynchronous interface and allowing parallel reads would introduce
significant complexity. It is also limited to Android O+ which limits its value
at the moment.

For now, we can rely on either:

- AsyncRequestQueue's fallback support for regular Cache, which uses the blocking
  executor to perform reads. This is functional, but does make heavier use of the
  blocking executor than is ideal, and also does not currently permit parallel
  reads, although this could be added later as an improvement to DiskBasedCache.

- Cronet's own HTTP cache (although at the moment, we call disableCache(); we can
  make this configurable).

See google#181
@jpd236 jpd236 changed the title Revert DiskBasedCache. Revert AsyncDiskBasedCache. Sep 26, 2020
@jpd236 jpd236 requested a review from jbiral September 26, 2020 00:19
@jpd236 jpd236 merged commit a4954c6 into google:master Sep 28, 2020
@jpd236 jpd236 deleted the revert-cache branch September 28, 2020 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants