Commit 49e7c0b4 authored by Takashi Toyoshima's avatar Takashi Toyoshima Committed by Commit Bot

OOR-CORS: update preflight cache expiration time upper limit

Currently, 14% of cache accesses result in cache-hit with stale entry.
This rate is a little high compared to cache-miss, happening at 18%.

This patch updates the expiration time upper limit from 10 minutes
to 2 hours so that the stale rate would not dominate.

I expect this would change the stale rate to be <5%. But if this
doesn't, I will revert this change.

Bug: 131368
Change-Id: I18f91c60b441128f966cd1f20743ca69e9091d75
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1614003
Commit-Queue: Takashi Toyoshima <toyoshim@chromium.org>
Commit-Queue: Yutaka Hirano <yhirano@chromium.org>
Auto-Submit: Takashi Toyoshima <toyoshim@chromium.org>
Reviewed-by: default avatarYutaka Hirano <yhirano@chromium.org>
Cr-Commit-Position: refs/heads/master@{#660331}
parent ea3f7253
...@@ -28,12 +28,7 @@ constexpr base::TimeDelta kDefaultTimeout = base::TimeDelta::FromSeconds(5); ...@@ -28,12 +28,7 @@ constexpr base::TimeDelta kDefaultTimeout = base::TimeDelta::FromSeconds(5);
// Maximum cache expiry time. Even if a CORS-preflight response contains // Maximum cache expiry time. Even if a CORS-preflight response contains
// Access-Control-Max-Age header that specifies a longer expiry time, this // Access-Control-Max-Age header that specifies a longer expiry time, this
// maximum time is applied. // maximum time is applied.
// constexpr base::TimeDelta kMaxTimeout = base::TimeDelta::FromHours(2);
// Note: Should be short enough to minimize the risk of using a poisoned cache
// after switching to a secure network.
// TODO(toyoshim): Consider to invalidate all entries when network configuration
// is changed. See also discussion at https://crbug.com/131368.
constexpr base::TimeDelta kMaxTimeout = base::TimeDelta::FromSeconds(600);
// Holds TickClock instance to overwrite TimeTicks::Now() for testing. // Holds TickClock instance to overwrite TimeTicks::Now() for testing.
const base::TickClock* tick_clock_for_testing = nullptr; const base::TickClock* tick_clock_for_testing = nullptr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment