From 41c04e728866bd66e10ecd2bd11b08fef8e1cdb7 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Fri, 18 Aug 2017 17:06:17 +0200 Subject: [PATCH] Add current locale to commit partial cache key --- app/views/projects/commits/_commit.html.haml | 2 +- changelogs/unreleased/dm-commit-cache-i18n.yml | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 changelogs/unreleased/dm-commit-cache-i18n.yml diff --git a/app/views/projects/commits/_commit.html.haml b/app/views/projects/commits/_commit.html.haml index e7da47032be..7e8a5a38086 100644 --- a/app/views/projects/commits/_commit.html.haml +++ b/app/views/projects/commits/_commit.html.haml @@ -5,7 +5,7 @@ - notes = commit.notes - note_count = notes.user.count -- cache_key = [project.full_path, commit.id, current_application_settings, note_count, @path.presence, current_controller?(:commits)] +- cache_key = [project.full_path, commit.id, current_application_settings, note_count, @path.presence, current_controller?(:commits), I18n.locale] - cache_key.push(commit.status(ref)) if commit.status(ref) = cache(cache_key, expires_in: 1.day) do diff --git a/changelogs/unreleased/dm-commit-cache-i18n.yml b/changelogs/unreleased/dm-commit-cache-i18n.yml new file mode 100644 index 00000000000..dbcb8e8afd2 --- /dev/null +++ b/changelogs/unreleased/dm-commit-cache-i18n.yml @@ -0,0 +1,5 @@ +--- +title: Add current locale to commit partial cache key +merge_request: +author: +type: fixed