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

bug: Set the correct cache headers for static files #16

Merged
merged 2 commits into from
May 16, 2022
Merged

bug: Set the correct cache headers for static files #16

merged 2 commits into from
May 16, 2022

Conversation

Jarrku
Copy link
Contributor

@Jarrku Jarrku commented May 16, 2022

The cache header values are currently passed as seconds instead of ms, which the library that @fastify/static uses expects (https://www.npmjs.com/package/send#maxage).

You can pass a string value which is correctly parsed in the the right amount of ms.

There's another issue I've noticed, the assetsBuildDirectory files do not get handled by the stricter handler (with immutable).

I've tried to set the prefix to /build/ so they're correctly picked up, but I receive errors for double registration of routes then.
Unsure how to properly resolve that issue.

@mcansh
Copy link
Owner

mcansh commented May 16, 2022

thanks for the fix @Jarrku 🙏 - i'll take a look at the build prefix issue in a bit

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.

None yet

2 participants