Repository navigation
Add Cache-Control header to cache static files for 1 day - #151
Merged
Merged
Conversation
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
Address caching for redirects/errors and document the mod_headers requirement for non-Docker deployments.
Review effort: Lite
Findings: None
What changed in this PR
Adds a one-day Cache-Control policy for Apache-served pages and static assets.
Changes:
- Adds
Cache-Control: max-age=86400. - Enables Apache
mod_headers. - Extends integration tests.
- Removes outdated README caching documentation.
| File | Summary |
|---|---|
www/.htaccess |
Adds the cache header. Moderate findings: it excludes redirects/errors and requires documented mod_headers support. |
tests/integration.bash |
Verifies caching headers for pages, feeds, and assets. |
README.md |
Removes obsolete caching documentation. |
Dockerfile |
Enables Apache mod_headers. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This changeset adds a
Cache-Controlheader so all files are cached for 1 day. Previously the origin sent no caching headers at all, so this was left to whatever sits in front of it: Bunny CDN currently answers with anything between 1 day and 30 days depending on the file, so a changed page or script can keep serving stale for up to a month.The 1 day matches what the CDN has been configured with since #145 and what the README has claimed since #93. Sending it from the origin means it applies consistently, survives a CDN change and is covered by the integration tests, which now check it for pages, the feed and static assets alike.
Builds on top of #93, #136 and #147
Refs #145 and https://github.com/clue-engineering/miley/pull/94 (private)