Skip to content

Commit

Permalink
Add Cache-Control header so proxy cache won't cache the pages.
Browse files Browse the repository at this point in the history
  • Loading branch information
steverandy authored and defunkt committed Jul 19, 2011
1 parent d85097d commit a55973a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/resque/server.rb
Expand Up @@ -119,13 +119,14 @@ def poll
end

def show(page, layout = true)
response["Cache-Control"] = "max-age=0, private, must-revalidate"
begin
erb page.to_sym, {:layout => layout}, :resque => Resque
rescue Errno::ECONNREFUSED
erb :error, {:layout => false}, :error => "Can't connect to Redis! (#{Resque.redis_id})"
end
end

def show_for_polling(page)
content_type "text/html"
@polling = true
Expand All @@ -136,12 +137,12 @@ def show_for_polling(page)
get "/?" do
redirect url_path(:overview)
end

%w( overview workers ).each do |page|
get "/#{page}.poll" do
show_for_polling(page)
end

get "/#{page}/:id.poll" do
show_for_polling(page)
end
Expand Down

0 comments on commit a55973a

Please sign in to comment.