public static function setVaryByCustom($actionName, $value) {
        if (!self::canCache($actionName)) { return; }
        self::$settings[$actionName]['varyByCustom'] = function($actionContext) use ($value) {
            return $value($actionContext);
        };
    }
public static function setVaryByCustom($actionName, $value) {
        if (!self::canCache($actionName)) { return; }
        self::$settings[$actionName]['varyByCustom'] = function($actionContext) use ($value) {
            return $value($actionContext);
        };
    }
public static function setVaryByCustom ( $ actionName , $ value ) { if ( ! self :: canCache ( $ actionName ) ) { return ; } self :: $ settings [ $ actionName ] [ 'varyByCustom' ] = function ( $ actionContext ) use ( $ value ) { return $ value ( $ actionContext ) ; } ; }
Sets the vary-by-custom.

@param string $actionName Action name.
@param callback $value 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 vary - by - custom .