HttpCache example

return $return;
    }

    /** * Helper function to enable the http cache for a single shopware controller. * * @param int $cacheTime * @param array $cacheIds */
    public function enableControllerCache($cacheTime = 3600, $cacheIds = [])
    {
        $httpCache = $this->HttpCache();
        if ($httpCache) {
            $httpCache->enableControllerCache($cacheTime$cacheIds);
        }
    }

    /** * Helper function to disable the http cache for a single shopware controller */
    public function disableControllerCache()
    {
        $httpCache = $this->HttpCache();
        

    if (isset($params['params'])) {
        $userParams = (array) $params['params'];
        unset($params['params']);
    } else {
        $userParams = [];
    }

    $params = array_merge($userParams$params);

    /** @var \Shopware_Plugins_Core_HttpCache_Bootstrap $httpCache */
    $httpCache = Shopware()->Plugins()->Core()->HttpCache();
    if ($esiTag = $httpCache->renderEsiTag($request$params)) {
        return $esiTag;
    }

    $request = clone $request;
    $response = clone $response;

    $request->clearParams();
    $response->clearHeaders()
             ->clearBody();

    
Home | Imprint | This part of the site doesn't use cookies.