Skip to content

fix: LazyCache and LazyListCache with bearer_auth find the SSR response - #636

Open
sfisol wants to merge 1 commit into
masterfrom
lazy-cache-token-fix
Open

sfisol wants to merge 1 commit into
masterfrom
lazy-cache-token-fix

Conversation

@sfisol

@sfisol sfisol commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator

The server keeps what it fetched during SSR under the request as sent, its bearer token included, but both caches looked it up by the request without the token (to_request(None)). With bearer_auth they never found it: hydration threw away the part of the page made from it, and the cache fetched again. Both now look it up by the request as sent.

Tests: ssr_fetched_request pretends the server fetched a given request; a cache with the same token starts with the response, one with another token does not.

The server keeps what it fetched during SSR under the request as sent,
its bearer token included, but both caches looked it up by the request
without the token (to_request(None)). With bearer_auth they never found
it: hydration threw away the part of the page made from it, and the
cache fetched again. Both now look it up by the request as sent.

Tests: ssr_fetched_request pretends the server fetched a given request;
a cache with the same token starts with the response, one with another
token does not.
@sfisol
sfisol requested a review from szagi3891 November 7, 2026 21:02
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.

2 participants