Nexcessnet_Turpentine_Model_Varnish_Configurator_Abstract::_vcl_sub_normalize_user_agent PHP Méthode

_vcl_sub_normalize_user_agent() protected méthode

Get the User-Agent normalization sub routine
protected _vcl_sub_normalize_user_agent ( ) : string
Résultat string
    protected function _vcl_sub_normalize_user_agent()
    {
        /**
         * Mobile regex from
         * @link http://magebase.com/magento-tutorials/magento-design-exceptions-explained/
         */
        $tpl = <<<EOS
if (req.http.User-Agent ~ "iP(?:hone|ad|od)|BlackBerry|Palm|Googlebot-Mobile|Mobile|mobile|mobi|Windows Mobile|Safari Mobile|Android|Opera (?:Mini|Mobi)") {
        set req.http.X-Normalized-User-Agent = "mobile";
    } else {
        set req.http.X-Normalized-User-Agent = "other";
    }

EOS;
        return $tpl;
    }