summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-03-04 10:34:35 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-03-04 10:34:35 +0100
commitbf921d084e9f5e9e541d033db49c5c99eed1deb2 (patch)
treebf44876cb2894e24100b1f6087793e50c9f61e5f /app
parentf8c4dc97230c520df077c1274fd8d88680da5242 (diff)
downloadgitlab-ce-bf921d084e9f5e9e541d033db49c5c99eed1deb2.tar.gz
Invalidate cache for builds badge
Closes #13982
Diffstat (limited to 'app')
-rw-r--r--app/controllers/projects/badges_controller.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/controllers/projects/badges_controller.rb b/app/controllers/projects/badges_controller.rb
index a4dd94b941c..dc9c96df003 100644
--- a/app/controllers/projects/badges_controller.rb
+++ b/app/controllers/projects/badges_controller.rb
@@ -1,4 +1,6 @@
class Projects::BadgesController < Projects::ApplicationController
+ before_action :set_no_cache
+
def build
respond_to do |format|
format.html { render_404 }
@@ -8,4 +10,15 @@ class Projects::BadgesController < Projects::ApplicationController
end
end
end
+
+ private
+
+ def set_no_cache
+ expires_now
+
+ # Add some deprecated headers for older agents
+ #
+ response.headers['Pragma'] = 'no-cache'
+ response.headers['Expires'] = 'Fri, 01 Jan 1990 00:00:00 GMT'
+ end
end