-
Notifications
You must be signed in to change notification settings - Fork 1.4k
docs: improve docs around cache control order and redirects #7744
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
base: main
Are you sure you want to change the base?
docs: improve docs around cache control order and redirects #7744
Conversation
|
841996c
to
a824938
Compare
a824938
to
4415d80
Compare
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your help @FHachez
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @FHachez 👌. I'll discuss this with the core team first. In the meantime you can address my comments and add your name to the list of contributors if you want to :)
// To override the default, set it explicitly | ||
cacheControl('day'); | ||
throw redirect(302, '/new-location'); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah looking at it like that on this code snippet, it really does look like a footgun and seems unintuitive. Will discuss this with the core team before merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would probably separate this code snippet into two code snippets each with its own explanation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah looking at it like that on this code snippet, it really does look like a footgun and seems unintuitive. Will discuss this with the core team before merging.
Indeed
I would probably separate this code snippet into two code snippets each with its own explanation.
Good idea, I've updated the PR.
…e list of contributors of the doc.
What is it?
Description
The goal is to clarify the doc around the ordering of the cache control headers and their impact on the redirects.
It follows this issue #7742 where we had surprised with cached redirects.
Checklist