Invalidate gitlab-pages internal api cache with 'Project::ProjectAttributesChangedEvent' event
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), needs to be invalidated in some application events (&7920 (closed)).
What is this issue
This issue is introduce the cache invalidation for the Project::ProjectVisibilityChangedEvent event.
The relevant project attributes that invalidate the cache are:
project.visibility
project.pages_https_only
To invalidate the cache the event must contain at least:
- the project id
- project namespace id
- project root namespace id