Sub-issue of the AI for Business Leaders performance PBI. Fully isolated one-line change β can be picked up at any point.
Description
next.config.mjs sets:
images: {
minimumCacheTTL: 60,
...
}
Every /_next/image response therefore carries a 60-second cache lifetime. This is Lighthouse's "Use efficient cache lifetimes β Est savings of 246 KiB": repeat visitors and multi-page sessions re-download every optimised image.
Proposed solution
Raise minimumCacheTTL to a long value (a year, 31536000, is the usual choice). Image URLs are keyed on the source path plus width and quality, so a content change means a new upload path from Tina and a new URL β a long TTL is safe.
Check at the same time whether the CDN/host in front of the app is overriding the header, in which case it needs the same treatment.
Acceptance criteria
/_next/image responses carry a long Cache-Control max-age
- Lighthouse's "Use efficient cache lifetimes" no longer lists optimised images
- Replacing an image in Tina still shows the new image without a manual purge
Sub-issue of the AI for Business Leaders performance PBI. Fully isolated one-line change β can be picked up at any point.
Description
next.config.mjssets:Every
/_next/imageresponse therefore carries a 60-second cache lifetime. This is Lighthouse's "Use efficient cache lifetimes β Est savings of 246 KiB": repeat visitors and multi-page sessions re-download every optimised image.Proposed solution
Raise
minimumCacheTTLto a long value (a year,31536000, is the usual choice). Image URLs are keyed on the source path plus width and quality, so a content change means a new upload path from Tina and a new URL β a long TTL is safe.Check at the same time whether the CDN/host in front of the app is overriding the header, in which case it needs the same treatment.
Acceptance criteria
/_next/imageresponses carry a longCache-Controlmax-age