class ASF::ETAG_Deflator_workaround

Running deflate and etag together confuses caching:

httpd.apache.org/docs/trunk/mod/mod_deflate.html#deflatealteretag

scarff.id.au/blog/2009/apache-304-and-mod_deflate-revisited/

workaround is to strip the suffix in Rack middleware

Public Class Methods

new(app) click to toggle source

capture the app

# File lib/whimsy/asf/rack.rb, line 191
def initialize(app)
  @app = app
end

Public Instance Methods

call(env) click to toggle source

strip -gzip from the If-None-Match HTTP header.

# File lib/whimsy/asf/rack.rb, line 196
def call(env)
  if env['HTTP_IF_NONE_MATCH']
    env['HTTP_IF_NONE_MATCH'] =
      env['HTTP_IF_NONE_MATCH'].sub(/-gzip"$/, '"')
  end

  return @app.call(env)
end