芝麻web文件管理V1.00
编辑当前文件:/home/asmplong/www/ancien-site-2019/site/plugins/system/cache/cache.php
'page', 'browsercache' => $this->params->get('browsercache', false), 'caching' => false, ); jimport('joomla.cache.cache'); $this->_cache = JCache::getInstance('page', $options); } /** * Converting the site URL to fit to the HTTP request * */ function onAfterInitialise() { global $_PROFILER; $app = JFactory::getApplication(); $user = JFactory::getUser(); if ($app->isAdmin() || JDEBUG) { return; } if ($user->get('guest') && $_SERVER['REQUEST_METHOD'] == 'GET') { $this->_cache->setCaching(true); } $data = $this->_cache->get(); if ($data !== false) { JResponse::setBody($data); echo JResponse::toString($app->getCfg('gzip')); if (JDEBUG) { $_PROFILER->mark('afterCache'); echo implode('', $_PROFILER->getBuffer()); } $app->close(); } } function onAfterRender() { $app = JFactory::getApplication(); if ($app->isAdmin() || JDEBUG) { return; } $user = JFactory::getUser(); if ($user->get('guest')) { //We need to check again here, because auto-login plugins have not been fired before the first aid check $this->_cache->store(); } } }