New issue
Advanced search Search tips

Issue 623159 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

Don't preserve caches opened on behalf of QuotaManager size requests

Project Member Reported by jkarlin@chromium.org, Jun 24 2016

Issue description

On first use of CacheStorage the QuotaManager will ask for all of the origins sizes. This results in opening all of the caches on disk and getting their size. This behavior is bad enough, but to make it worse the CacheStorage will hold onto recently opened caches for 30 seconds. That's wasted memory.

We should only preserve caches opened on behalf of the document. And consider reducing the time that the cache is kept open.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jun 29 2016

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

commit 848127113da87ca062b139a6ab1de1b16a6df1d4
Author: jkarlin <jkarlin@chromium.org>
Date: Wed Jun 29 14:17:25 2016

[CacheStorage] Temporarily preserved recently opened caches from CacheStorageDispatcherHost

Currently when a cache is opened it is preserved for 30 seconds by
content::CacheStorage so that, in case the cache is accessed again soon it
doesn't have to be reopened. This happened in
https://codereview.chromium.org/1470073003/.

We don't want to preserve every opened cache. Particularly, we don't want to
preserve caches opened by the QuotaManager when it's determining the size of
all of the caches. We only want to preserve caches opened on behalf of documents.

This CL moves the preservation logic to the CacheStorageDispatcherHost, where
open calls from the document are made. That way open calls from other clients don't
trigger preservation. The CL also lowers the time that the cache is held open to 5
seconds from 30 as that should be more than enough time between cache actions on most
pages.

BUG= 623159 

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

[modify] https://crrev.com/848127113da87ca062b139a6ab1de1b16a6df1d4/content/browser/cache_storage/cache_storage.cc
[modify] https://crrev.com/848127113da87ca062b139a6ab1de1b16a6df1d4/content/browser/cache_storage/cache_storage.h
[modify] https://crrev.com/848127113da87ca062b139a6ab1de1b16a6df1d4/content/browser/cache_storage/cache_storage_dispatcher_host.cc
[modify] https://crrev.com/848127113da87ca062b139a6ab1de1b16a6df1d4/content/browser/cache_storage/cache_storage_manager_unittest.cc
[delete] https://crrev.com/cab2a4a473efbf392a980d9caba64f70477c1426/content/browser/cache_storage/cache_storage_unittest.cc
[modify] https://crrev.com/848127113da87ca062b139a6ab1de1b16a6df1d4/content/content_tests.gypi

Status: Fixed (was: Started)

Sign in to add a comment