Skip to content

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

FHachez
Copy link

@FHachez FHachez commented Jul 18, 2025

What is it?

  • Docs

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

@FHachez FHachez requested a review from a team as a code owner July 18, 2025 21:19
Copy link

changeset-bot bot commented Jul 18, 2025

⚠️ No Changeset found

Latest commit: 6617caa

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@FHachez FHachez force-pushed the improve_docs_around_cache_control_order_and_redirects branch 2 times, most recently from 841996c to a824938 Compare July 18, 2025 21:27
@FHachez FHachez force-pushed the improve_docs_around_cache_control_order_and_redirects branch from a824938 to 4415d80 Compare July 18, 2025 21:27
Copy link
Contributor

github-actions bot commented Jul 18, 2025

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
qwik-docs ✅ Ready (View Log) Visit Preview 4415d80

gioboa
gioboa previously approved these changes Jul 18, 2025
Copy link
Member

@gioboa gioboa left a 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

@gioboa gioboa requested review from wmertens and maiieul July 18, 2025 23:32
@gioboa gioboa added the COMP: docs Improvements or additions to documentation label Jul 18, 2025
Copy link
Contributor

@maiieul maiieul left a 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');
};
Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
COMP: docs Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants