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.45 app/middleware/workarea/rack_cache_config_middleware.rb
workarea-core-3.4.44 app/middleware/workarea/rack_cache_config_middleware.rb
workarea-core-3.4.43 app/middleware/workarea/rack_cache_config_middleware.rb
workarea-core-3.4.42 app/middleware/workarea/rack_cache_config_middleware.rb
workarea-core-3.4.41 app/middleware/workarea/rack_cache_config_middleware.rb
workarea-core-3.4.40 app/middleware/workarea/rack_cache_config_middleware.rb
workarea-core-3.4.39 app/middleware/workarea/rack_cache_config_middleware.rb
workarea-core-3.4.38 app/middleware/workarea/rack_cache_config_middleware.rb
workarea-core-3.4.37 app/middleware/workarea/rack_cache_config_middleware.rb
workarea-core-3.4.36 app/middleware/workarea/rack_cache_config_middleware.rb
workarea-core-3.4.35 app/middleware/workarea/rack_cache_config_middleware.rb
workarea-core-3.4.34 app/middleware/workarea/rack_cache_config_middleware.rb
workarea-core-3.4.33 app/middleware/workarea/rack_cache_config_middleware.rb
workarea-core-3.4.32 app/middleware/workarea/rack_cache_config_middleware.rb
workarea-core-3.4.31 app/middleware/workarea/rack_cache_config_middleware.rb
workarea-core-3.4.30 app/middleware/workarea/rack_cache_config_middleware.rb
workarea-core-3.4.29 app/middleware/workarea/rack_cache_config_middleware.rb
workarea-core-3.4.28 app/middleware/workarea/rack_cache_config_middleware.rb
workarea-core-3.4.27 app/middleware/workarea/rack_cache_config_middleware.rb
workarea-core-3.4.26 app/middleware/workarea/rack_cache_config_middleware.rb