src/Comodojo/Dispatcher/Cache/ServerCache.php
public function dump(
        Request $request,
        Response $response,
        Route $route
    ) {

        if ( $this->bypass === true ) {
            return false;
        }

        $cache = strtoupper($route->getParameter('cache'));
        $ttl = $route->getParameter('ttl');
        $name = self::getCacheName($request);
        $method = (string)$request->getMethod();
        $status = $response->getStatus()->get();

        if (
            ($cache == 'SERVER' || $cache == 'BOTH') &&
            in_array($method, self::$cachable_methods) &&
            in_array($status, self::$cachable_statuses)
        ) {
            $this->getCache()
                ->setNamespace(self::$cache_namespace)
                ->set(
                    $name,
                    $response->export(),
                    $ttl === null ? self::DEFAULTTTL : intval($ttl)
                );
            return true;
        }

        return false;

    }
public function dump(
        Request $request,
        Response $response,
        Route $route
    ) {

        if ( $this->bypass === true ) {
            return false;
        }

        $cache = strtoupper($route->getParameter('cache'));
        $ttl = $route->getParameter('ttl');
        $name = self::getCacheName($request);
        $method = (string)$request->getMethod();
        $status = $response->getStatus()->get();

        if (
            ($cache == 'SERVER' || $cache == 'BOTH') &&
            in_array($method, self::$cachable_methods) &&
            in_array($status, self::$cachable_statuses)
        ) {
            $this->getCache()
                ->setNamespace(self::$cache_namespace)
                ->set(
                    $name,
                    $response->export(),
                    $ttl === null ? self::DEFAULTTTL : intval($ttl)
                );
            return true;
        }

        return false;

    }
public function dump ( Request $ request , Response $ response , Route $ route ) { if ( $ this -> bypass === true ) { return false ; } $ cache = strtoupper ( $ route -> getParameter ( 'cache' ) ) ; $ ttl = $ route -> getParameter ( 'ttl' ) ; $ name = self :: getCacheName ( $ request ) ; $ method = ( string ) $ request -> getMethod ( ) ; $ status = $ response -> getStatus ( ) -> get ( ) ; if ( ( $ cache == 'SERVER' || $ cache == 'BOTH' ) && in_array ( $ method , self :: $ cachable_methods ) && in_array ( $ status , self :: $ cachable_statuses ) ) { $ this -> getCache ( ) -> setNamespace ( self :: $ cache_namespace ) -> set ( $ name , $ response -> export ( ) , $ ttl === null ? self :: DEFAULTTTL : intval ( $ ttl ) ) ; return true ; } return false ; }
Dump the full request object in the cache

@param Request $request
The request model (to extract cache definition)
@param Response $response
The response object that will be cached
@param Route $route
The route model (to extract cache parameters)
@return bool
Dump the full request object in the cache