From ebede2b3ff1c2b089529c4f9d6268641580e280b Mon Sep 17 00:00:00 2001 From: "Z.J. van de Weg" Date: Fri, 12 May 2017 15:19:27 +0200 Subject: Use etag caching for environments JSON For the index view, the environments can now be requested every 15 seconds. Any transition state of a projects environments will trigger a cache invalidation action. Fixes gitlab-org/gitlab-ce#31701 --- app/controllers/projects/environments_controller.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app/controllers/projects/environments_controller.rb') diff --git a/app/controllers/projects/environments_controller.rb b/app/controllers/projects/environments_controller.rb index fd57afbd05f..537c74d5231 100644 --- a/app/controllers/projects/environments_controller.rb +++ b/app/controllers/projects/environments_controller.rb @@ -15,6 +15,8 @@ class Projects::EnvironmentsController < Projects::ApplicationController respond_to do |format| format.html format.json do + Gitlab::PollingInterval.set_header(response, interval: 15_000) + render json: { environments: EnvironmentSerializer .new(project: @project, current_user: @current_user) -- cgit v1.2.1 From 3be9820da63d77ab8b4469dbbb5385292f928057 Mon Sep 17 00:00:00 2001 From: "Z.J. van de Weg" Date: Tue, 23 May 2017 10:43:55 +0200 Subject: Test etag caching router and incorporate review --- app/controllers/projects/environments_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/controllers/projects/environments_controller.rb') diff --git a/app/controllers/projects/environments_controller.rb b/app/controllers/projects/environments_controller.rb index 537c74d5231..d85bf44ae4d 100644 --- a/app/controllers/projects/environments_controller.rb +++ b/app/controllers/projects/environments_controller.rb @@ -15,7 +15,7 @@ class Projects::EnvironmentsController < Projects::ApplicationController respond_to do |format| format.html format.json do - Gitlab::PollingInterval.set_header(response, interval: 15_000) + Gitlab::PollingInterval.set_header(response, interval: 3_000) render json: { environments: EnvironmentSerializer -- cgit v1.2.1