navigation: Preserve HTTP cache partition across main-frame reloads [chromium/src : main]

0 views
Skip to first unread message

Helmut Januschka (Gerrit)

unread,
Aug 17, 2026, 5:20:31 PM (3 days ago) Aug 17
to Andrew Williams, Charlie Reis, Tsuyoshi Horo, Peter Beverloo, Maks Orlovich, Nidhi Jaju, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, Chromium LUCI CQ, loading...@chromium.org, navigation...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, network-ser...@chromium.org, lizeb+watch...@chromium.org, webapks-...@chromium.org, aixba+wat...@chromium.org, dibyapal+wa...@chromium.org, dmurph+watc...@chromium.org, gavin...@chromium.org, japhet+...@chromium.org, kuragin+web-ap...@chromium.org, loyso...@chromium.org, mek+w...@chromium.org, mgiuca...@chromium.org, net-r...@chromium.org, philli...@chromium.org, webap...@microsoft.com, zelin+watch-we...@chromium.org
Attention needed from Charlie Reis

Helmut Januschka added 1 comment

Patchset-level comments
File-level comment, Patchset 14:
Helmut Januschka . unresolved

hi @cr...@chromium.org, it was suggested I ask for your navigation expertise on this one. The root cause is that an opaque-initiator PWA launch uses the `cn_` HTTP cache partition, while `location.reload()` uses the regular partition, leaving future cold launches on stale `cn_` content. PS14 preserves the original cache classification across reloads, but that is a broad change with security implications, so guidance on whether reloads should retain that classification at all would be greatly appreciated. thank you!

Charlie Reis

Apologies for the delay; I've got a lot in my queue right now.

I appreciate the brief summary, but I'm having trouble fitting together these pieces. Can you update the CL description a bit more to explain the current understanding of the problem and how this is fixing it?

Between this summary and a quick skim of the bug, my best guess is that it's related to partitioning the HTTP cache (https://crbug.com/347934841)? It sounds like that partitioning is based on initiator origins, but maybe PWAs have a special case where an opaque initiator origin is used, but not if you do a renderer-initiated reload, so we end up using different cache partitions for those cases?

I'm hesitant to add new NavigationEntry state that might need persisting, but I want to make sure I understand what problem is being solved first, and whether it affects other scenarios (e.g., with other types of opaque initiator origins) as well. Thanks!

Helmut Januschka

Thanks for taking a look! update commit msg, sorry missed that, had like a few plot twists.

The mechanism: since crbug.com/347934841, main-frame navigation cache keys get a "cn_" prefix when the request initiator is cross-site to the destination, and opaque initiators always count as cross-site.


Android PWA/WebAPK launches navigate with an opaque initiator (crrev.com/c/3966130), so every cold launch reads/writes the "cn_" partition.

location.reload() is renderer-initiated with the document's own origin, which is same-site, so the fresh response lands in the unprefixed partition and future launches keep serving the stale "cn_" entry; it never self-heals.

It isn't PWA-specific: any cross-site-initiated navigation (link from another site, other opaque initiators) followed by a reload has the same partition flip, which is why the added browser test uses a plain cross-site navigation with no PWA involved.

On the NavigationEntry state: it's intentionally not persisted (similar to isolation_info_).

If it's missing, e.g. after session restore, the reload falls back to the frame entry's initiator, i.e. today's behavior, so the worst case is one cache miss. The reason it can't be derived from the FrameNavigationEntry's initiator_origin alone is that each commit updates that field, so after the first reload the original classification would be lost for subsequent reloads.

The design question I'd appreciate your take on, should a reload retain the original navigation's cache classification at all (as PS14 does), or would you prefer fixing the mismatch elsewhere?

Happy to rework if you see a cleaner point.

again thank you, and dont worry about delay's!

Open in Gerrit

Related details

Attention is currently required from:
  • Charlie Reis
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ib00986659a8b3360c1dc9777d9ea4236e36ca328
Gerrit-Change-Number: 8051344
Gerrit-PatchSet: 15
Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
Gerrit-Reviewer: Charlie Reis <cr...@chromium.org>
Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
Gerrit-CC: Andrew Williams <awi...@chromium.org>
Gerrit-CC: Maks Orlovich <morl...@chromium.org>
Gerrit-CC: Nidhi Jaju <nidh...@chromium.org>
Gerrit-CC: Peter Beverloo <pe...@chromium.org>
Gerrit-CC: Tsuyoshi Horo <ho...@chromium.org>
Gerrit-Attention: Charlie Reis <cr...@chromium.org>
Gerrit-Comment-Date: Mon, 17 Aug 2026 21:20:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Helmut Januschka <hel...@januschka.com>
Comment-In-Reply-To: Charlie Reis <cr...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Charlie Reis (Gerrit)

unread,
Aug 19, 2026, 8:24:08 PM (15 hours ago) Aug 19
to Helmut Januschka, Andrew Williams, Tsuyoshi Horo, Peter Beverloo, Maks Orlovich, Nidhi Jaju, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, Chromium LUCI CQ, loading...@chromium.org, navigation...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, network-ser...@chromium.org, lizeb+watch...@chromium.org, webapks-...@chromium.org, aixba+wat...@chromium.org, dibyapal+wa...@chromium.org, dmurph+watc...@chromium.org, gavin...@chromium.org, japhet+...@chromium.org, kuragin+web-ap...@chromium.org, loyso...@chromium.org, mek+w...@chromium.org, mgiuca...@chromium.org, net-r...@chromium.org, philli...@chromium.org, webap...@microsoft.com, zelin+watch-we...@chromium.org
Attention needed from Andrew Williams

Charlie Reis added 1 comment

Patchset-level comments
Helmut Januschka . unresolved

hi @cr...@chromium.org, it was suggested I ask for your navigation expertise on this one. The root cause is that an opaque-initiator PWA launch uses the `cn_` HTTP cache partition, while `location.reload()` uses the regular partition, leaving future cold launches on stale `cn_` content. PS14 preserves the original cache classification across reloads, but that is a broad change with security implications, so guidance on whether reloads should retain that classification at all would be greatly appreciated. thank you!

Charlie Reis

Apologies for the delay; I've got a lot in my queue right now.

I appreciate the brief summary, but I'm having trouble fitting together these pieces. Can you update the CL description a bit more to explain the current understanding of the problem and how this is fixing it?

Between this summary and a quick skim of the bug, my best guess is that it's related to partitioning the HTTP cache (https://crbug.com/347934841)? It sounds like that partitioning is based on initiator origins, but maybe PWAs have a special case where an opaque initiator origin is used, but not if you do a renderer-initiated reload, so we end up using different cache partitions for those cases?

I'm hesitant to add new NavigationEntry state that might need persisting, but I want to make sure I understand what problem is being solved first, and whether it affects other scenarios (e.g., with other types of opaque initiator origins) as well. Thanks!

Helmut Januschka

Thanks for taking a look! update commit msg, sorry missed that, had like a few plot twists.

The mechanism: since crbug.com/347934841, main-frame navigation cache keys get a "cn_" prefix when the request initiator is cross-site to the destination, and opaque initiators always count as cross-site.


Android PWA/WebAPK launches navigate with an opaque initiator (crrev.com/c/3966130), so every cold launch reads/writes the "cn_" partition.

location.reload() is renderer-initiated with the document's own origin, which is same-site, so the fresh response lands in the unprefixed partition and future launches keep serving the stale "cn_" entry; it never self-heals.

It isn't PWA-specific: any cross-site-initiated navigation (link from another site, other opaque initiators) followed by a reload has the same partition flip, which is why the added browser test uses a plain cross-site navigation with no PWA involved.

On the NavigationEntry state: it's intentionally not persisted (similar to isolation_info_).

If it's missing, e.g. after session restore, the reload falls back to the frame entry's initiator, i.e. today's behavior, so the worst case is one cache miss. The reason it can't be derived from the FrameNavigationEntry's initiator_origin alone is that each commit updates that field, so after the first reload the original classification would be lost for subsequent reloads.

The design question I'd appreciate your take on, should a reload retain the original navigation's cache classification at all (as PS14 does), or would you prefer fixing the mismatch elsewhere?

Happy to rework if you see a cleaner point.

again thank you, and dont worry about delay's!

Charlie Reis

Thanks for the explanation! This does sound like a deeper design level concern with the partitioned HTTP cache, with a fundamental question about how reloads after any cross-site navigation should be treated.

awillia@: Was this discussed at all during the design of that feature? Do you have thoughts on how it should behave?

It does seem tricky to tie the cache to an initiator origin if subsequent same-origin navigations (including reloads) will then switch to a different cache.

Open in Gerrit

Related details

Attention is currently required from:
  • Andrew Williams
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ib00986659a8b3360c1dc9777d9ea4236e36ca328
Gerrit-Change-Number: 8051344
Gerrit-PatchSet: 15
Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
Gerrit-Reviewer: Andrew Williams <awi...@chromium.org>
Gerrit-Reviewer: Charlie Reis <cr...@chromium.org>
Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
Gerrit-CC: Maks Orlovich <morl...@chromium.org>
Gerrit-CC: Nidhi Jaju <nidh...@chromium.org>
Gerrit-CC: Peter Beverloo <pe...@chromium.org>
Gerrit-CC: Tsuyoshi Horo <ho...@chromium.org>
Gerrit-Attention: Andrew Williams <awi...@chromium.org>
Gerrit-Comment-Date: Thu, 20 Aug 2026 00:23:53 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages