Invalidate gitlab-pages internal api cache with 'Project created' 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 created event.
For the cache invalidation the event must contain:
project id
project namespace id
project's root namespace id