Skip to content

Instantly share code, notes, and snippets.

@mdub
Created March 11, 2011 09:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mdub/865671 to your computer and use it in GitHub Desktop.
Save mdub/865671 to your computer and use it in GitHub Desktop.
if defined?(Heroku::StaticAssetsMiddleware)
puts "Carefully adjusting Heroku::StaticAssetsMiddleware"
class Heroku::StaticAssetsMiddleware
def can_cache?(reply)
status, headers, body = reply
# if there's already a "Cache-Control" header, don't override it
body.kind_of?(Rack::File) and status.to_i == 200 and !headers.has_key?("Cache-Control")
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment