protected function store(Request $request, Response $response)
    {
        try {
            $this->store->write($request, $response);

            $this->record($request, 'store');

            $response->headers->set('Age', $response->getAge());
        } catch (\Exception $e) {
            $this->record($request, 'store-failed');

            if ($this->options['debug']) {
                throw $e;
            }
        }

        // now that the response is cached, release the lock
        $this->store->unlock($request);
    }
protected function store(Request $request, Response $response)
    {
        try {
            $this->store->write($request, $response);

            $this->record($request, 'store');

            $response->headers->set('Age', $response->getAge());
        } catch (\Exception $e) {
            $this->record($request, 'store-failed');

            if ($this->options['debug']) {
                throw $e;
            }
        }

        // now that the response is cached, release the lock
        $this->store->unlock($request);
    }
protected function store ( Request $ request , Response $ response ) { try { $ this -> store -> write ( $ request , $ response ) ; $ this -> record ( $ request , 'store' ) ; $ response -> headers -> set ( 'Age' , $ response -> getAge ( ) ) ; } catch ( \ Exception $ e ) { $ this -> record ( $ request , 'store-failed' ) ; if ( $ this -> options [ 'debug' ] ) { throw $ e ; } } // now that the response is cached, release the lock $ this -> store -> unlock ( $ request ) ; }
Writes the Response to the cache.

@throws \Exception
Writes the Response to the cache .