-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
New middleware for headers #183
Comments
Did you already start creating the middleware? I started with the TS interfaces. If you have any code I can test with let me know. |
No, I didn't start. If you want to give a try, I'll appreciate it :) |
I'm guessing this is related, but it would be nice if we could cache HTTP requests. It seems there is middleware for 'no-cache' but when I push a copy of (https://github.com/lumeland/base-blog/)[https://github.com/lumeland/base-blog/] to Vercel it does not cache any HTTP requests. I'm guessing the example at (https://lumeland.github.io/base-blog/)[https://lumeland.github.io/base-blog/] has HTTP headers automatically set within the GitHub service since there does not appear to be anything in the code setting the caching header. (I just began playing with Lume today. I love it.) |
@kuhlaid These middlewares are used only for Deno runtime environment. Vercel doesn't run Deno (just serve statically the pages build by Lume). For cache, Lume has the expires middleware, that set the |
Thank you @oscarotero. I had tried setting the caching options in a vercel.json configuration but was not able to find a combo of header properties to get caching to fully work. I looked at https://lume-blog.vercel.app/ but it does not use caching. My use-case is at https://schm-website-ymxq58e94-kuhlaid.vercel.app/posts/secondpost/ and the {
"headers": [
{
"source": "/(.*)",
"headers": [
{
"key": "Cache-Control",
"value": "max-age=3600"
}
]
}
]
} |
@kuhlaid To me, your configuration works fine. The content is cached the first time and then it uses the cached version: PD: thanks for your post about Lume :) |
To add custom headers to some urls.
So it could support something like this: https://docs.netlify.com/routing/headers/
The text was updated successfully, but these errors were encountered: