Repository navigation
Is it intentional that I can't set Cache-Control headers on cachedEventHandler?
#1945
Unanswered
niklas-may
asked this question in
Q&A
Replies: 0 comments
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.
When you use the
cachedEventHandlerfunction,Cache-Controlheaders are automatically set on the response based on the handler's options object. See here. Setting these headers will make other entities cache the response accordingly—for example, CDNs or browsers.But in my scenario, I only want nitro to cache the response. But every other part should treat this response as dynamic/private.
This handler...
... will result in these headers.
Overriding the headers explicitly is, unfortunately, not possible.
Is this behavior intentional and I am missing some cache-control knowledge, or is this a bug?
I am very happy to get any insights.
All reactions