Replies: 1 comment 3 replies
-
I believe this must be a bug; if Would you like to send a PR to address that? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I'm trying to use Undici cache in a NodeJS frontend, but I'm not sure about what my backend API should set max-age to.
I setup the cache in the frontend with
With max-age=0 is in the response, upon UNDICI.request the client always sends these headers, without if-none-match or if-modified-since:
the server return these headers:
Repeated requests then always return 200.
If I change max-age to 1 in the response, the requests contains if-none-match and if-modified-since:
Thus subsequent requests return 304
Shouldn't cache work with max-age=0 too, and possibily with no-cache? Am I missing something in the backend response header?
Just to be clear, I would like EVERY request to be checked with if-none-match, and for this reason I am using max-age=0
I'm using NodeJS v22.20.0 and Undici v7.16.0
Beta Was this translation helpful? Give feedback.
All reactions