Skip to content

Instantly share code, notes, and snippets.

@kbighorse
Created September 26, 2012 04:43
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 kbighorse/3786109 to your computer and use it in GitHub Desktop.
Save kbighorse/3786109 to your computer and use it in GitHub Desktop.
# production.rb
...
config.middleware.use Rack::Cache
# Deflater is inserted here so gzipped assets aren't cached
config.middleware.insert_before Rack::Cache, Rack::Deflater
config.middleware.insert_after(Rack::Cache, Rack::ReverseProxy) do
reverse_proxy_options :preserve_host => true
reverse_proxy '/blog', 'http://bighorse.net'
end
# https://devcenter.heroku.com/articles/rack-cache-memcached-static-assets-rails31#configure-rails-cachestore
config.action_dispatch.rack_cache = {
:metastore => Dalli::Client.new,
:entitystore => 'file:tmp/cache/rack/body',
:allow_reload => false
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment