CacheStorage: Write index after simple disk_cache.
When we load the cache_storage index we try to determine if its fresh or stale by comparing its timestamp against the timestamp of the various simple disk_cache directories. Both cache_storage and simple disk_cache write their index files out using a delay. The cache_storage delay is 5 seconds and the simple disk_cache delay is 20 seconds. This means that the simple disk_cache index is always written last and as a result the cache_storage index is almost always considered stale. This CL fix this by extending the cache_storage delay to match the simple disk_cache delay. It also implements a shorter delay on android when in the background like simple disk_cache uses to avoid losing data when the app is killed by the operating system. Finally, the CL also now properly flushes the index to disk if there is a pending write when the cache_storage subsystem is torn down. Over time this should cause ServiceWorkerCache.UsedIndexFileSize to show more cases where the index file is used to provide the size. Bug: 988001 Change-Id: Idaa09b956edcfa9e70ac1fdb9b43adcd73ec0508 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1721389 Commit-Queue: Daniel Murphy <dmurph@chromium.org> Reviewed-by:Daniel Murphy <dmurph@chromium.org> Cr-Commit-Position: refs/heads/master@{#682409}
Showing
Please register or sign in to comment