Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- set :normalize_asset_timestamps, false
- #Etags should be based on the file parameters only (default includes INode)
- FileETag MTime Size
- #Rewrite stuff
- RewriteEngine On
- #This sets the environment variable (is_versioned) when the URL query string
- #looks like ?874353948543 or any string of digits
- RewriteCond %{QUERY_STRING} ^[0-9]+$
- RewriteRule ^(.*)$ $1 [env=is_versioned:true]
- <Directory /deployed-rails-app/public/ >
- Options -Indexes FollowSymLinks -MultiViews
- AllowOverride None
- Order allow,deny
- allow from all
- #For files, force the browser to rely on cache-control directives and
- #Rails asset timestamps by removing Etags and Last-Modified dates
- #For all assets that aren't stamped by rails, cache them for ~ 3 hours
- Header set "Cache-Control" "max-age=10000"
- Header unset Etag
- Header unset "Last-Modified"
- #For all assets that ARE stamped by rails, cache them for 30 days
- Header set "Cache-Control" "max-age=2592000" env=is_versioned
- </Directory>
Add Comment
Please, Sign In to add comment