Commit eeb5f423 authored by Igor Drozdov's avatar Igor Drozdov

Merge branch 'home-panel-tag-caching' into 'master'

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

See merge request gitlab-org/gitlab!57031
parents b6f2d9b6 43042095
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
- show_auto_devops_callout = show_auto_devops_callout?(@project) - show_auto_devops_callout = show_auto_devops_callout?(@project)
- max_project_topic_length = 15 - max_project_topic_length = 15
- emails_disabled = @project.emails_disabled? - emails_disabled = @project.emails_disabled?
- cache_enabled = Feature.enabled?(:cache_home_panel, type: :development, default_enabled: :yaml)
.project-home-panel.js-show-on-project-root.gl-my-5{ class: [("empty-project" if empty_repo)] } .project-home-panel.js-show-on-project-root.gl-my-5{ class: [("empty-project" if empty_repo)] }
.gl-display-flex.gl-justify-content-space-between.gl-flex-wrap.gl-sm-flex-direction-column.gl-mb-3 .gl-display-flex.gl-justify-content-space-between.gl-flex-wrap.gl-sm-flex-direction-column.gl-mb-3
...@@ -23,7 +24,9 @@ ...@@ -23,7 +24,9 @@
- if current_user - if current_user
%span.access-request-links.gl-ml-3 %span.access-request-links.gl-ml-3
= render 'shared/members/access_request_links', source: @project = render 'shared/members/access_request_links', source: @project
- if @project.tag_list.present? - if @project.tag_list.present?
= cache_if(cache_enabled, [@project, :tag_list], expires_in: 1.day) do
%span.home-panel-topic-list.mt-2.w-100.d-inline-flex.gl-font-base.gl-font-weight-normal.gl-align-items-center %span.home-panel-topic-list.mt-2.w-100.d-inline-flex.gl-font-base.gl-font-weight-normal.gl-align-items-center
= sprite_icon('tag', css_class: 'icon gl-relative gl-mr-2') = sprite_icon('tag', css_class: 'icon gl-relative gl-mr-2')
...@@ -41,7 +44,7 @@ ...@@ -41,7 +44,7 @@
.text-nowrap.has-tooltip{ data: { container: 'body' }, title: @project.has_extra_topics? ? @project.topics_not_shown.join(', ') : nil } .text-nowrap.has-tooltip{ data: { container: 'body' }, title: @project.has_extra_topics? ? @project.topics_not_shown.join(', ') : nil }
= _("+ %{count} more") % { count: @project.count_of_extra_topics_not_shown } = _("+ %{count} more") % { count: @project.count_of_extra_topics_not_shown }
= cache_if(cache_enabled, [@project, :buttons, current_user, @notification_setting], expires_in: 1.day) do
.project-repo-buttons.gl-display-flex.gl-justify-content-md-end.gl-align-items-start.gl-flex-wrap.gl-mt-5 .project-repo-buttons.gl-display-flex.gl-justify-content-md-end.gl-align-items-start.gl-flex-wrap.gl-mt-5
- if current_user - if current_user
.gl-display-flex.gl-align-items-start.gl-mr-3 .gl-display-flex.gl-align-items-start.gl-mr-3
...@@ -53,6 +56,7 @@ ...@@ -53,6 +56,7 @@
= render 'projects/buttons/fork' = render 'projects/buttons/fork'
- if can?(current_user, :download_code, @project) - if can?(current_user, :download_code, @project)
= cache_if(cache_enabled, [@project, :download_code], expires_in: 1.minute) do
%nav.project-stats %nav.project-stats
.nav-links.quick-links .nav-links.quick-links
- if @project.empty_repo? - if @project.empty_repo?
...@@ -80,6 +84,7 @@ ...@@ -80,6 +84,7 @@
= render_if_exists "projects/home_mirror" = render_if_exists "projects/home_mirror"
- if @project.badges.present? - if @project.badges.present?
= cache_if(cache_enabled, [@project, :badges], expires_in: 1.day) do
.project-badges.mb-2 .project-badges.mb-2
- @project.badges.each do |badge| - @project.badges.each do |badge|
%a.gl-mr-3{ href: badge.rendered_link_url(@project), %a.gl-mr-3{ href: badge.rendered_link_url(@project),
......
---
title: Cache project tag list
merge_request: 57031
author:
type: performance
---
name: cache_home_panel
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/57031
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/328421
milestone: '13.12'
type: development
group: group::source code
default_enabled: false
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment