Skip to content

Preload commits markdown cache for CommitsController

What does this MR do and why?

Follow up for !35314 (merged)

Problem

We trigger n+1 requests to Redis for each commit on the page.

Solution

Use the #with_markdown_cache method to avoid unnecessary requests.

Screenshots or screen recordings

Before After
Screenshot_2022-05-25_at_16.14.48 Screenshot_2022-05-25_at_16.15.21

How to set up and validate locally

  1. Visit http://127.0.0.1:3000/gitlab-org/gitlab-test/-/commits/master
  2. Check Redis link on performance tab

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Vasilii Iakliushin

Merge request reports