我在我的网站上使用 ESI 缓存;那里工作正常,今天我清除了 APC 缓存和 sf2 缓存,我看到一切正常。但是有些人看不到esi面板等。
为什么会这样,如何解决?我不明白为什么我和一些朋友可以看得很清楚而其他人看不到?
Using symfony 2.1.7
以这种方式渲染:
$response=new Response();
$response= $this->render('HomePageBundle:Default:index.html.twig', array(...
$response->setPrivate(true);
$response->setMaxAge(300);
return $response;
我的 web/app.php 文件
require_once __DIR__.'/../app/bootstrap.php.cache';
require_once __DIR__.'/../app/AppKernel.php';
require_once __DIR__.'/../app/AppCache.php';
$loader = new ApcClassLoader('tb_sf2', $loader);
$loader->register(true);
$kernel = new AppKernel('prod', false);
$kernel->loadClassCache();
// wrap the default AppKernel with the AppCache one
$kernel = new AppCache($kernel);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
但如果这是一个错误,我也不会看到 esi 面板,对吧?
我再次清除了缓存一段时间(可能是 30 分钟后),有人说:
现在我可以看到左侧菜单,但顶部仍然什么都没有
我清除了日志,然后我的朋友刷新了……这个日志是为每个 ESI 面板添加的:
[2013-05-27 23:03:17] request.INFO: Matched route "home_page_homepage" (parameters: "_controller": "TB\HomePageBundle\Controller\DefaultController::indexAction", "_route": "home_page_homepage") [] []
[2013-05-27 23:03:17] app.INFO: Locale Query Guessing Service Loaded [] []
[2013-05-27 23:03:17] app.INFO: Locale has not been identified by the Query guessing service [] []
[2013-05-27 23:03:17] app.INFO: Locale Session Guessing Service Loaded [] []
[2013-05-27 23:03:17] app.INFO: Locale has been identified by guessing service: ( Session ) [] []
[2013-05-27 23:03:17] app.INFO: Setting [ en ] as defaultLocale for the Request [] []
[2013-05-27 23:03:17] security.DEBUG: Read SecurityContext from the session [] []
[2013-05-27 23:03:17] security.DEBUG: Reloading user from user provider. [] []
[2013-05-27 23:03:17] security.DEBUG: Username "MbrunoM" was reloaded from user provider. [] []
[2013-05-27 23:03:18] security.DEBUG: Write SecurityContext in the session [] []
[2013-05-27 23:03:18] request.INFO: Matched route "notifications_box_esi" (parameters: "_controller": "TB\HomePageBundle\Controller\DefaultController::notificationsBoxEsiAction", "max": "10", "_route": "notifications_box_esi") [] []
[2013-05-27 23:03:18] app.INFO: Locale Query Guessing Service Loaded [] []
[2013-05-27 23:03:18] app.INFO: Locale has not been identified by the Query guessing service [] []
[2013-05-27 23:03:18] app.INFO: Locale Query Guessing Service Loaded [] []
[2013-05-27 23:03:18] app.INFO: Locale has not been identified by the Query guessing service [] []
[2013-05-27 23:03:18] app.INFO: Locale Session Guessing Service Loaded [] []
[2013-05-27 23:03:18] app.INFO: Locale has been identified by guessing service: ( Session ) [] []
[2013-05-27 23:03:18] app.INFO: Setting [ en ] as defaultLocale for the Request [] []
[2013-05-27 23:03:18] security.DEBUG: Read SecurityContext from the session [] []
[2013-05-27 23:03:18] security.DEBUG: Reloading user from user provider. [] []
[2013-05-27 23:03:18] security.DEBUG: Username "MbrunoM" was reloaded from user provider. [] []
[2013-05-27 23:03:18] security.DEBUG: Access is denied (and user is neither anonymous, nor remember-me) by "/var/www/domain.com/framework/vendor/symfony/symfony/src/Symfony/Component/Security/Http/Firewall/AccessListener.php" at line 70 [] []
[2013-05-27 23:03:18] security.DEBUG: Access is denied (and user is neither anonymous, nor remember-me) by "/var/www/domain.com/framework/vendor/symfony/symfony/src/Symfony/Component/Security/Http/Firewall/AccessListener.php" at line 70 [] []