Skip to content

Cache the loading hints partial [RUN ALL RSPEC] [RUN AS-IF-FOSS]

Robert May requested to merge cached-loading-hints into master

What does this MR do?

Saves roughly 30ms per page load by caching the _loading_hints partial on a short TTL of 1.minute. The time savings mostly come from avoiding the settings query, but a 1 minute delay on changes to Gitlab::CurrentSettings.snowplow_enabled? seems a worthy trade-off for a global 30ms page speed improvement to me.

See !57350 (merged) for previous example of this caching technique.

Before

Rendered layouts/_loading_hints.html.haml (Duration: 39.9ms | Allocations: 54634) [cache miss]

After

Rendered layouts/_loading_hints.html.haml (Duration: 0.5ms | Allocations: 162) [cache hit]

Screenshots (strongly suggested)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.

  • 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 🤖

Merge request reports

Loading