public function controllerActionPredispatch(Varien_Event_Observer $observer)
    {
        if (!$this->_getHelper()->isActive()) {
            return $this;
        }

        /* @var $controllerAction Mage_Core_Controller_Front_Action */
        $controllerAction = $observer->getControllerAction();

        $this->_getHelper()->setCurrentPage(
            strtolower($controllerAction->getFullActionName('_'))
        );
        
        $surrogateCompatibility = $controllerAction->getRequest()->getServer('HTTP_SURROGATE_CAPABILITY', '');
        
        if (strpos($surrogateCompatibility, 'ESI/') !== false) {
            $this->_getHelper()->setIsEsiAllowed(true);
        }
        
        if ($this->_getHelper()->isAllowedCurrentPage() 
            || $this->_getHelper()->getIsInternal()) {
            // Disable ?__SID=U in urls
            Mage::app()->setUseSessionVar(false);
            Mage::app()->setUseSessionInUrl(false);
        }
        
        Mage::getSingleton('ecomdev_varnish/cookie')->setRequest($controllerAction->getRequest());

        if ($token = $controllerAction->getRequest()->getParam('form_key')) {
            if ($this->_getHelper()->validateToken($token)) {
                Mage::getSingleton('core/session')->setData('_form_key', $token);
                // After we set token, it is not valid anymore for next request, so we need to generate a new one
                $this->_getHelper()->generateToken();
            }
        }

        return $this;
    }