Draft: Add chunked caching to project header
What does this MR do?
Adds multi-fetch caching to the project home using https://gitlab.com/robotmay/chunky_cache. This performs a cache multi-fetch for all the chunks, which means there's no excessive network overhead for many small caches. Each chunk can be separately scoped by the key components too, to make user-specific caches if needed.
Benchmarks
Not too sure what the requests with double allocations are doing, but on average the caching results in about 50k fewer allocations per template render. On my machine this translates into ~50-100ms faster rendering just by partially caching this header area.
Without cache
Rendered projects/show.html.haml within layouts/project (Duration: 276.4ms | Allocations: 416177)
Rendered projects/show.html.haml within layouts/project (Duration: 156.5ms | Allocations: 183385)
Rendered projects/show.html.haml within layouts/project (Duration: 287.9ms | Allocations: 417796)
Rendered projects/show.html.haml within layouts/project (Duration: 206.2ms | Allocations: 183407)
Rendered projects/show.html.haml within layouts/project (Duration: 165.1ms | Allocations: 183412)
With cache
Rendered projects/show.html.haml within layouts/project (Duration: 112.8ms | Allocations: 134686)
Rendered projects/show.html.haml within layouts/project (Duration: 118.3ms | Allocations: 134647)
Rendered projects/show.html.haml within layouts/project (Duration: 113.3ms | Allocations: 133141)
Rendered projects/show.html.haml within layouts/project (Duration: 124.1ms | Allocations: 133173)
Rendered projects/show.html.haml within layouts/project (Duration: 118.7ms | Allocations: 134647)
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