def call(env)
      if :get == env[:method]
        if env[:parallel_manager]
          # callback mode
          cache_on_complete(env)
        else
          # synchronous mode
          key = cache_key(env)
          unless response = cache.read(key) and response
            response = @app.call(env)
            store_response_in_cache(key, response)
          end
          finalize_response(response, env)
        end
      else
        @app.call(env)
      end
    end
def call(env)
      if :get == env[:method]
        if env[:parallel_manager]
          # callback mode
          cache_on_complete(env)
        else
          # synchronous mode
          key = cache_key(env)
          unless response = cache.read(key) and response
            response = @app.call(env)
            store_response_in_cache(key, response)
          end
          finalize_response(response, env)
        end
      else
        @app.call(env)
      end
    end
Public: initialize the middleware.

 cache   - An object that responds to read and write (default: nil).
 options - An options Hash (default: {}):
           :ignore_params - String name or Array names of query params
                            that should be ignored when forming the cache
                            key (default: []).
           :write_options - Hash of settings that should be passed as the third
                            options parameter to the cache's #write method. If not
                            specified, no options parameter will be passed.

 Yields if no cache is given. The block should return a cache object.