Invalidate Pages API cache with PagesDomains::PagesDomainCreatedEvent
What does this MR do and why?
Context
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 PagesDomains::PagesDomainCreatedEvent
introduced in !98125 (merged).
Related to: #374027 (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
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
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.
-
I have evaluated the MR acceptance checklist for this MR.