Skip to content

💸 Raise image minimumCacheTTL so optimised images stay cached - #4918

Draft
isaaclombardssw wants to merge 1 commit into
mainfrom
perf/4902-image-cache-ttl
Draft

💸 Raise image minimumCacheTTL so optimised images stay cached#4918
isaaclombardssw wants to merge 1 commit into
mainfrom
perf/4902-image-cache-ttl

Conversation

@isaaclombardssw

Copy link
Copy Markdown
Member

Closes #4902

next.config.mjs set images.minimumCacheTTL: 60, so every /_next/image response carried a 60-second cache lifetime — repeat visitors and multi-page sessions re-downloaded (and the server re-optimised) every image. This is Lighthouse's "Use efficient cache lifetimes" finding.

Raised it to a year (31536000), the usual choice. Optimised image URLs are keyed on source path + width + quality, so changing an image in Tina produces a new upload path and therefore a new URL — the long TTL is safe and doesn't require a manual purge.

One-line change; the rest of the images block is untouched to avoid conflicts with the other open PRs on this file.

Note: the acceptance criteria also ask to confirm the CDN/host in front of the app isn't overriding the Cache-Control header and to re-run Lighthouse — those verifications need a deploy and should be checked on the preview/staging slot.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q8genJyZboXaa4vgYhJF4P

next.config.mjs set images.minimumCacheTTL to 60s, so every /_next/image
response was near-uncacheable and re-optimised constantly. Raise it to a
year (31536000). Image URLs are keyed on source path + width + quality, so a
content change in Tina produces a new upload path and a new URL — a long TTL
is safe.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q8genJyZboXaa4vgYhJF4P
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

💸 Perf - Raise minimumCacheTTL so optimised images are cacheable

1 participant