Cache parts of the home_panel partial [RUN ALL RSPEC] [RUN AS-IF-FOSS]
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
-
📋 Does this MR need a changelog?-
I have included a changelog entry. -
I have not included a changelog entry because _____.
-
-
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
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 🤖