Improve headers for diff and patch of a commit

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

  • Close this issue

Why are we doing this work

CommitController#show can be rendered as diff or path:

  • diff
  • patch

Currently, the cache headers are:

cache-control: no-cache
pragma: no-cache

However, at least the public content can be served via CDN:

cache-control: max-age=3600, public, must-revalidate, stale-while-revalidate=60, stale-if-error=300, s-maxage=60
etag: "e12a66ade493301905400bc87638b510"

Relevant links

  • https://gitlab.com/gitlab-com/gl-infra/reliability/-/issues/11554#note_1271042070
  • Improve caching on raw endpoints (!98110 - merged)
  • Improve cache headers for archive repository an... (!109391 - merged)
Edited Sep 22, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading