Skip to content
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

maxAge = 3600000 (41 days) is not a sensible default value #98

Open
pinkasey opened this issue Oct 2, 2024 · 3 comments
Open

maxAge = 3600000 (41 days) is not a sensible default value #98

pinkasey opened this issue Oct 2, 2024 · 3 comments

Comments

@pinkasey
Copy link

pinkasey commented Oct 2, 2024

https://github.com/strapi-community/strapi-plugin-rest-cache/blob/main/packages/strapi-plugin-rest-cache/server/types/CacheRouteConfig.js

image

In fact, it has caused me a serious bug in production.
A sensible value would be 3600, which is 1 hour, which is what I think the author has intended

@derrickmehaffy
Copy link

Max age is in Ms which 3,600,000ms is one hour.

@pinkasey
Copy link
Author

pinkasey commented Oct 2, 2024

right.

I'm sending it as response header, so that causes me troubles.
I assumed maxAge would be in seconds.
I see the code now.

@pinkasey
Copy link
Author

pinkasey commented Oct 2, 2024

I suggest you change the definition of maxAge on version 5.x.x (it is a breaking change) - to seconds instead of milliseconds.

Also -
document the units. it's not specified in the docs
image

(also the 2 other places where you can config it)
image

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

No branches or pull requests

2 participants