public static function set($actionName, $duration, $location, $varyByParam = null, $varyByHeader = null, $varyByCustom = null) {
        if (!self::canCache($actionName)) { return; }

        self::$settings[$actionName]['duration'] = $duration;
        self::$settings[$actionName]['location'] = $location;

        if (!empty($varyByParam)) {
            self::$settings[$actionName]['varyByParam'] = $varyByParam;
        }

        if (!empty($varyByHeader)) {
            self::$settings[$actionName]['varyByHeader'] = $varyByHeader;
        }

        if (!empty($varyByCustom)) {
            self::$settings[$actionName]['varyByCustom'] = $varyByCustom;
        }
    }
public static function set($actionName, $duration, $location, $varyByParam = null, $varyByHeader = null, $varyByCustom = null) {
        if (!self::canCache($actionName)) { return; }

        self::$settings[$actionName]['duration'] = $duration;
        self::$settings[$actionName]['location'] = $location;

        if (!empty($varyByParam)) {
            self::$settings[$actionName]['varyByParam'] = $varyByParam;
        }

        if (!empty($varyByHeader)) {
            self::$settings[$actionName]['varyByHeader'] = $varyByHeader;
        }

        if (!empty($varyByCustom)) {
            self::$settings[$actionName]['varyByCustom'] = $varyByCustom;
        }
    }
public static function set ( $ actionName , $ duration , $ location , $ varyByParam = null , $ varyByHeader = null , $ varyByCustom = null ) { if ( ! self :: canCache ( $ actionName ) ) { return ; } self :: $ settings [ $ actionName ] [ 'duration' ] = $ duration ; self :: $ settings [ $ actionName ] [ 'location' ] = $ location ; if ( ! empty ( $ varyByParam ) ) { self :: $ settings [ $ actionName ] [ 'varyByParam' ] = $ varyByParam ; } if ( ! empty ( $ varyByHeader ) ) { self :: $ settings [ $ actionName ] [ 'varyByHeader' ] = $ varyByHeader ; } if ( ! empty ( $ varyByCustom ) ) { self :: $ settings [ $ actionName ] [ 'varyByCustom' ] = $ varyByCustom ; } }
Sets the cache settings.

@param string $actionName Action name.
@param int $duration A cache duration value, in seconds.
@param int $location A cache location. Please see OutputCacheLocation class.
@param string|null $varyByParam A semicolon-separated list of strings that correspond to query-string values for the GET method, or to parameter values for the POST method.
@param string|null $varyByHeader A semicolon-separated list of HTTP headers that are used to vary the output cache.
@param callback|null $varyByCustom A function to check.
For example: function($actionContext) {
$userAgent = $actionContext->getHttpContext()->getRequest()->server('HTTP_USER_AGENT');
$browser = get_browser($userAgent, true);

if ($browser['browser'] == 'Firefox') {
return true;
}
else {
return false;
}
}

@return void
Sets the cache settings .