Skip to content

RMST-364 - Implementing cache-control header for git-reader routes#1224

Merged
alexcottner merged 9 commits intomainfrom
rmst-364
Mar 24, 2026
Merged

RMST-364 - Implementing cache-control header for git-reader routes#1224
alexcottner merged 9 commits intomainfrom
rmst-364

Conversation

@alexcottner
Copy link
Contributor

@alexcottner alexcottner commented Mar 22, 2026

RMST-364

Adding cache rules to git-reader. This works similarly to what we have in the v1 readers, but I tried to simplify it into the main cache rules that we have.

  • Volatile content that frequently changes (broadcasts, preview data, frequently changed endpoints, etc). Default to 60 seconds ttl.
  • Stable content that rarely changes (changesets, hello, etc). Default to 1 hour ttl.
  • Static content that doesn't change (attachments, cert-chains). Default to 1 week ttl.

Uses our existing Settings pattern.
Updated documentation.

@alexcottner alexcottner changed the title WIP - working on cache-control changes for git-reader RMST-364 - Implimenting cache-control header for git-reader routes Mar 24, 2026
@alexcottner alexcottner marked this pull request as ready for review March 24, 2026 16:01
@alexcottner alexcottner requested a review from a team as a code owner March 24, 2026 16:01
@alexcottner alexcottner requested a review from leplatrem March 24, 2026 16:01
Copy link
Contributor

@leplatrem leplatrem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👌

While reading the diff, I was thinking we could have a helper like add_cache_header(response, settings, "long") but it adds one indirection and I don't think it's justified

Regarding the middleware, I think it's the right pattern. Setting the env var with monkeypath is the only way if we want to set it to tempdir

@leplatrem
Copy link
Contributor

We currently list settings in the README, maybe we could remove them and keep deployment.rst only

@alexcottner
Copy link
Contributor Author

Good call. Also realizing that our formatting in deployment.rst was slightly off. Fixing formatting and adjusting read-me to link to the latest documentation.

@alexcottner alexcottner merged commit ba8b354 into main Mar 24, 2026
12 checks passed
@alexcottner alexcottner deleted the rmst-364 branch March 24, 2026 17:14
@alexcottner alexcottner changed the title RMST-364 - Implimenting cache-control header for git-reader routes RMST-364 - Implementing cache-control header for git-reader routes Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants