Skip to content

Use MergeRequestDiff#patch_id_sha as ck for diffs_batch

Patrick Bajao requested to merge 411546-patch-id-sha-ck into master

What does this MR do and why?

The ck param is used by the client (e.g. browser) to cache the request on client side.

We are previously using the MergeRequestDiff#id which can change often since we regenerate the HEAD diff when target branch changes as well.

To ensure that the client cache doesn't invalidate often, we utilize the MergeRequestDiff#patch_id_sha so ck won't change if the diff didn't really change when the diff was regenerated.

This is behind diffs_batch_cache_with_max_age feature flag.

MR acceptance checklist

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

Related to #411546 (closed)

Edited by Patrick Bajao

Merge request reports