Skip to content

Conversation

yoshisatoyanagisawa
Copy link
Collaborator

@yoshisatoyanagisawa yoshisatoyanagisawa commented Sep 5, 2025

This change corrects the cache resolution logic within the Handle Fetch algorithm when the router source is RouterSourceEnum/"cache".

The Problem:
Previously, the algorithm always used reservedClient to resolve the storage key, regardless of the request type. However, reservedClient is only valid for top-level navigation requests and is not available for subresource requests. This could lead to accessing the incorrect cache storage during subresource fetches.

The Fix:
Logic has been added to differentiate between a non-subresource request and a subresource request.

  • For a non-subresource request: It continues to use reservedClient as before.
  • For a subresource request: It now uses the client associated with the request object.

This ensures that the correct storage key, based on the requesting client, is used for subresource requests.

Fixes: #1784


Preview | Diff

This change corrects the cache resolution logic within the Handle Fetch
algorithm when the router source is RouterSourceEnum/"cache".

The Problem:
Previously, the algorithm always used reservedClient to resolve the
storage key, regardless of the request type. However, reservedClient is
only valid for top-level navigation requests and is not available for
subresource requests. This could lead to accessing the incorrect cache
storage during subresource fetches.

The Fix:
Logic has been added to differentiate between a non-subresource request
and a subresource request.
- For a non-subresource request: It continues to use reservedClient as
  before.
- For a subresource request: It now uses the client associated with the
  request object.

This ensures that the correct storage key, based on the requesting
client, is used for subresource requests.

Fixes: w3c#1784
@yoshisatoyanagisawa
Copy link
Collaborator Author

@wanderview Will you take a look? This should address your concern.
@monica-ch Will you review this?
@annevk @mkruisselbrink FYI.

@monica-ch
Copy link
Collaborator

LGTM, thanks for fixing!

@wanderview
Copy link
Member

LGTM

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.

What does "the registration’s storage key’s name to cache map" mean?
3 participants