Skip to content

Invalidate Pages API cache with Projects::ProjectTransferedEvent

What does this MR do and why?

For GET /api/internal/pages?host=HOST. This is the API endpoint that gets called by GitLab pages when a request comes in and we haven't cached in gitlab-pages what needs to be served for this.

Given that the satisfiedThreshold for writing headers for a response is 0.5s, ideally, this would be even faster than the threshold set for web-pages. We think 0.5s for serving a static page is an acceptable target.

Since this information generally does not change a lot, we could add a cache for the JSON response of this endpoint to help the metrics.

The cache introduced in #363867 (closed) (behind a feature flag), needs to be invalidated in some application events (&7920 (closed)).

This MR

This MR invalidates this cache with the Projects::ProjectTransferedEvent introduced in !92620 (merged).

Related to: #364064 (closed)

FAQ

  • Does it make sense to guard these changes under a FF?
    • The main feature, the cache itself, is behind a FF (cache_pages_domain_api, introduced in !88956 (merged))

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

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 Kassio Borges

Merge request reports