SSWConsulting / SSWConsulting/SSW.Website

💸 Perf - Raise minimumCacheTTL so optimised images are cacheable

Open
#4,902 0 comments 0 reactions 1 assignee View on GitHub

@isaaclombardssw is already working on this.

Since Jul 23, 2026.

Type: Refactor
Dominant language
HTML
Stars
14
Forks
10
Avg merge
13h 51m
Merged PRs (30d)
38

Description

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

  1. /_next/image responses carry a long Cache-Control max-age
  2. Lighthouse's "Use efficient cache lifetimes" no longer lists optimised images
  3. Replacing an image in Tina still shows the new image without a manual purge

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.