Skip to content

Commit a55973a

Browse files
steverandydefunkt
authored andcommitted
Add Cache-Control header so proxy cache won't cache the pages.
1 parent d85097d commit a55973a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/resque/server.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,14 @@ def poll
119119
end
120120

121121
def show(page, layout = true)
122+
response["Cache-Control"] = "max-age=0, private, must-revalidate"
122123
begin
123124
erb page.to_sym, {:layout => layout}, :resque => Resque
124125
rescue Errno::ECONNREFUSED
125126
erb :error, {:layout => false}, :error => "Can't connect to Redis! (#{Resque.redis_id})"
126127
end
127128
end
128-
129+
129130
def show_for_polling(page)
130131
content_type "text/html"
131132
@polling = true
@@ -136,12 +137,12 @@ def show_for_polling(page)
136137
get "/?" do
137138
redirect url_path(:overview)
138139
end
139-
140+
140141
%w( overview workers ).each do |page|
141142
get "/#{page}.poll" do
142143
show_for_polling(page)
143144
end
144-
145+
145146
get "/#{page}/:id.poll" do
146147
show_for_polling(page)
147148
end

0 commit comments

Comments
 (0)