Skip to content

Instantly share code, notes, and snippets.

View lrettig's full-sized avatar
🚀
Going to the moon

Lane Rettig lrettig

🚀
Going to the moon
View GitHub Profile
@guyboltonking
guyboltonking / compressed_static_assets.rb
Created March 21, 2012 20:37
Slightly hacky rails middleware for serving up precompiled gzipped assets
require 'action_dispatch/middleware/static'
module Middleware
class FileHandler < ActionDispatch::FileHandler
def initialize(root, assets_path, cache_control)
@assets_path = assets_path.chomp('/') + '/'
super(root, cache_control)
end
def match?(path)