Cache parts of the home_panel partial [RUN ALL RSPEC] [RUN AS-IF-FOSS]

Merged Robert May requested to merge home-panel-tag-caching into master

What does this MR do?

Caches the project topic list, buttons, badges, and stats on varying cache timers. This cuts the render time for _home_panel.html.haml roughly in half:

Uncached

Rendered projects/_home_panel.html.haml (Duration: 142.9ms | Allocations: 148494) [cache miss]

Cached

Rendered projects/_home_panel.html.haml (Duration: 78.6ms | Allocations: 84589) [cache hit]

Removes a few queries on most page loads. These caches all expire as the project is updated, but for the stats cache I have it set to a very short TTL (we've recently done this for !57350 (merged)) to prevent updating them on every page load - this could potentially be increased later but I'm unsure of whether those stats trigger the project cache key to rotate in every instance right now.

Related #325333 (closed)

Feature flag

cache_home_panel

Screenshots (strongly suggested)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by 🤖 GitLab Bot 🤖