diff options
author | Z.J. van de Weg <git@zjvandeweg.nl> | 2017-05-12 16:19:27 +0300 |
---|---|---|
committer | Z.J. van de Weg <git@zjvandeweg.nl> | 2017-05-22 22:55:43 +0300 |
commit | ebede2b3ff1c2b089529c4f9d6268641580e280b (patch) | |
tree | 08d0463762501180bf45444cd88cacf085e9bcd4 /app/controllers/projects/environments_controller.rb | |
parent | 50a00442285973a390fa448d189ee43cd700d668 (diff) |
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
Diffstat (limited to 'app/controllers/projects/environments_controller.rb')
-rw-r--r-- | app/controllers/projects/environments_controller.rb | 2 |
1 files changed, 2 insertions, 0 deletions
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) |