New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CACHE_ENABLED
should not affect CACHE_CONTROL_S_MAXAGE
#16772
Comments
Linear: ENG-111 |
Shouldn't |
@rijkvanzanten
I still think that |
Ohh that's a very interesting take! So you're suggesting one should be able to control the cache-control header completely separate from directus' own caching 🤔 I guess that makes sense! |
Yeah, kinda. In other words, defaulting to |
I like the idea of effectively decoupling the header from the main cache itself, as there are use cases where you want the header to do something differently from how the cache operates (like with s-max-age). At the same time are some parts that should remain automatic (like public/private). I think we can add a couple additional |
Describe the Bug
If I define
CACHE_CONTROL_S_MAXAGE > 0
and setCACHE_ENABLED = false
,Cache-Control
header is set tono-cache
. In my opinion I should be able to sets-maxage
without enabling Directus internal cache system.The workaround now is to create a hook that would modify
Cache-Control
before response is sent.Expected behavior
CACHE_CONTROL_S_MAXAGE = 600
andCACHE_ENABLED = false
should result in response with headerCache-Control: (public/private same as CACHE_ENABLED=true), s-maxage=600
.Errors Shown
No response
What version of Directus are you using?
9.19.1
What version of Node.js are you using?
N/A
What database are you using?
N/A
What browser are you using?
N/A
How are you deploying Directus?
N/A
The text was updated successfully, but these errors were encountered: