Sha256: 136957f29998eb0dba829735d3834704a1e4851f2578e9c68fb134830abf096b

Contents?: true

Size: 461 Bytes

Versions: 34

Compression:

Stored size: 461 Bytes

Contents

module Workarea
  class RackCacheConfigMiddleware
    def initialize(app)
      @app = app
    end

    def call(env)
      request = Rack::Request.new(env)
      env['rack-cache.cache_key'] = Cache::RackCacheKey

      if request.path !~ /(jpe?g|png|ico|gif|css|js)$/
        env['rack-cache.force-pass'] = request.cookies['cache'] == 'false'
        env['workarea.cache_varies'] = Cache::Varies.new(env).to_s
      end

      @app.call(env)
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
workarea-core-3.4.25 app/middleware/workarea/rack_cache_config_middleware.rb
workarea-core-3.4.24 app/middleware/workarea/rack_cache_config_middleware.rb
workarea-core-3.4.23 app/middleware/workarea/rack_cache_config_middleware.rb
workarea-core-3.4.22 app/middleware/workarea/rack_cache_config_middleware.rb
workarea-core-3.4.21 app/middleware/workarea/rack_cache_config_middleware.rb
workarea-core-3.4.20 app/middleware/workarea/rack_cache_config_middleware.rb
workarea-core-3.4.19 app/middleware/workarea/rack_cache_config_middleware.rb
workarea-core-3.4.18 app/middleware/workarea/rack_cache_config_middleware.rb
workarea-core-3.4.17 app/middleware/workarea/rack_cache_config_middleware.rb
workarea-core-3.4.16 app/middleware/workarea/rack_cache_config_middleware.rb
workarea-core-3.4.15 app/middleware/workarea/rack_cache_config_middleware.rb
workarea-core-3.4.14 app/middleware/workarea/rack_cache_config_middleware.rb
workarea-core-3.4.13 app/middleware/workarea/rack_cache_config_middleware.rb
workarea-core-3.4.12 app/middleware/workarea/rack_cache_config_middleware.rb