I'm trying to use Varnish as a backend storage for the blocks.
new Sonata\CoreBundle\SonataCoreBundle(),
new Sonata\CacheBundle\SonataCacheBundle(),
new Sonata\SeoBundle\SonataSeoBundle(),
new Sonata\EasyExtendsBundle\SonataEasyExtendsBundle(),
new Sonata\NotificationBundle\SonataNotificationBundle(),
new Application\Sonata\NotificationBundle\ApplicationSonataNotificationBundle(),
new Application\Sonata\PageBundle\ApplicationSonataPageBundle(),
new Sonata\BlockBundle\SonataBlockBundle(),
InvalidArgumentException: The service definition "sonata.cache.esi" does not exist.
in /home/users/gparis/workspace/vod-cms/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php line 867
at ContainerBuilder->getDefinition('sonata.cache.esi') in /home/users/gparis/workspace/vod-cms/vendor/sonata-project/block-bundle/DependencyInjection/SonataBlockExtension.php line 144
at SonataBlockExtension->configureCache(object(ContainerBuilder), array('default_contexts' => array('sonata_page_bundle'), 'context_manager' => 'sonata.page.block.context_manager', 'http_cache' => array('handler' => 'sonata.cache.esi', 'listener' => true), 'blocks' => array('sonata.user.block.menu' => array('contexts' => array('sonata_page_bundle'), 'cache' => 'sonata.cache.noop', 'settings' => array()), 'sonata.user.block.account' => array('contexts' => array('sonata_page_bundle'), 'cache' => 'sonata.cache.noop', 'settings' => array()), 'sonata.admin.block.admin_list' => array('contexts' => array('admin'), 'cache' => 'sonata.cache.noop', 'settings' => array()), 'sonata.block.service.text' => array('contexts' => array('sonata_page_bundle'), 'cache' => 'sonata.cache.noop', 'settings' => array()), 'sonata.block.service.rss' => array('contexts' => array('sonata_page_bundle'), 'cache' => 'sonata.cache.noop', 'settings' => array())), 'profiler' => array('enabled' => '%kernel.debug%', 'template' => 'SonataBlockBundle:Profiler:block.html.twig', 'container_types' => array('sonata.block.service.container', 'sonata.page.block.container', 'cmf.block.container', 'cmf.block.slideshow')), 'templates' => array('block_base' => null, 'block_container' => null), 'container' => array('types' => array('sonata.block.service.container', 'sonata.page.block.container', 'cmf.block.container', 'cmf.block.slideshow'), 'templates' => array('SonataPageBundle:Block:block_container.html.twig' => 'SonataPageBundle default template', 'SonataSeoBundle:Block:block_social_container.html.twig' => 'SonataSeoBundle (to contain social buttons)')), 'menus' => array(), 'blocks_by_class' => array(), 'exception' => array('default' => array('filter' => 'debug_only', 'renderer' => 'throw'), 'filters' => array('debug_only' => 'sonata.block.exception.filter.debug_only', 'ignore_block_exception' => 'sonata.block.exception.filter.ignore_block_exception', 'keep_all' => 'sonata.block.exception.filter.keep_all', 'keep_none' => 'sonata.block.exception.filter.keep_none'), 'renderers' => array('inline' => 'sonata.block.exception.renderer.inline', 'inline_debug' => 'sonata.block.exception.renderer.inline_debug', 'throw' => 'sonata.block.exception.renderer.throw')))) in /home/users/gparis/workspace/vod-cms/vendor/sonata-project/block-bundle/DependencyInjection/SonataBlockExtension.php line 65
at SonataBlockExtension->load(array(array('default_contexts' => array('sonata_page_bundle'), 'context_manager' => 'sonata.page.block.context_manager', 'http_cache' => array('handler' => 'sonata.cache.esi'), 'blocks' => array('sonata.user.block.menu' => null, 'sonata.user.block.account' => null, 'sonata.admin.block.admin_list' => array('contexts' => array('admin')), 'sonata.block.service.text' => null, 'sonata.block.service.rss' => null))), object(ContainerBuilder)) in /home/users/gparis/workspace/vod-cms/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php line 50
at MergeExtensionConfigurationPass->process(object(ContainerBuilder)) in /home/users/gparis/workspace/vod-cms/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/MergeExtensionConfigurationPass.php line 39
at MergeExtensionConfigurationPass->process(object(ContainerBuilder)) in /home/users/gparis/workspace/vod-cms/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/Compiler.php line 117
at Compiler->compile(object(ContainerBuilder)) in /home/users/gparis/workspace/vod-cms/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php line 613
at ContainerBuilder->compile() in /home/users/gparis/workspace/vod-cms/app/bootstrap.php.cache line 2496
at Kernel->initializeContainer() in /home/users/gparis/workspace/vod-cms/app/bootstrap.php.cache line 2275
at Kernel->boot() in /home/users/gparis/workspace/vod-cms/app/bootstrap.php.cache line 2306
at Kernel->handle(object(Request)) in /home/users/gparis/workspace/vod-cms/web/app_dev.php line 28
If I remove the line that configures the handler, I can see the esi cache backend service in the container:debug
command output.
app/console container:debug|grep cache
cache_clearer container Symfony\Component\HttpKernel\CacheClearer\ChainCacheClearer
cache_warmer container Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerAggregate
sensio_framework_extra.cache.listener container Sensio\Bundle\FrameworkExtraBundle\EventListener\HttpCacheListener
sonata.admin.route.cache container Sonata\AdminBundle\Route\RoutesCache
sonata.admin.route.cache_warmup container Sonata\AdminBundle\Route\RoutesCacheWarmUp
sonata.block.cache.handler n/a alias for "sonata.block.cache.handler.default"
sonata.block.cache.handler.default container Sonata\BlockBundle\Cache\HttpCacheHandler
sonata.block.cache.handler.noop container Sonata\BlockBundle\Cache\NoopHttpCacheHandler
sonata.cache.esi container Sonata\CacheBundle\Adapter\VarnishCache
sonata.cache.invalidation.simple container Sonata\CacheBundle\Invalidation\SimpleCacheInvalidation
sonata.cache.manager container Sonata\Cache\CacheManager
sonata.cache.model_identifier container Sonata\Cache\Invalidation\ModelCollectionIdentifiers
sonata.cache.noop container Sonata\Cache\Adapter\Cache\NoopCache
sonata.cache.orm.event_subscriber container Sonata\CacheBundle\Invalidation\DoctrineORMListenerContainerAware
sonata.cache.orm.event_subscriber.default container Sonata\CacheBundle\Invalidation\DoctrineORMListener
sonata.cache.recorder container Sonata\Cache\Invalidation\Recorder
sonata.page.cache.js_async container Sonata\PageBundle\Cache\BlockJsCache
sonata.page.cache.js_sync container Sonata\PageBundle\Cache\BlockJsCache
Note that the esi cache service appears after the cache handler service, so it might be an order problem.