Improve headers for diff and patch of a commit
<!--IssueSummary start--> <details> <summary> Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards. </summary> - [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=391251) </details> <!--IssueSummary end--> ## Why are we doing this work [CommitController#show](https://gitlab.com/gitlab-org/gitlab/blob/8f500e4f4d6e11e1231a70bc5b1ffc8119278ac5/app/controllers/projects/commit_controller.rb#L29-44) can be rendered as diff or path: - [diff](https://gitlab.com/gitlab-org/gitlab-foss/-/commit/608d6aaa3d80a33862ca2c29d96bfd687b1a011b.diff) - [patch](https://gitlab.com/gitlab-org/gitlab-foss/-/commit/608d6aaa3d80a33862ca2c29d96bfd687b1a011b.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 - https://gitlab.com/gitlab-org/gitlab/-/merge_requests/98110+ - https://gitlab.com/gitlab-org/gitlab/-/merge_requests/109391+
issue