Uploaded image for project: 'Ibexa IBX'
  1. Ibexa IBX
  2. IBX-610

LocationHandler methods are missing InMemory cache implementation

    XMLWordPrintable

Details

    Description

      Some methods in LocationHandler are missing InMemory cache implementation which results in multiple calls to SPI cache, deserialization, etc.

      Steps to reproduce
      1. Clean installation of eZ Platform 2.5/Ibexa DXP v3.2/v3.3
      2. Create a new TestController
      AppBundle\Controller\TestController

      <?php
      
      namespace AppBundle\Controller;
      
      use eZ\Publish\Core\Persistence\Cache\LocationHandler;
      use Symfony\Component\HttpFoundation\Response;
      
      class TestController
      {
          private $locationHandler;
      
          public function __construct(LocationHandler $locationHandler)
          {
              $this->locationHandler = $locationHandler;
          }
      
          public function testAction()
          {
              $this->locationHandler->loadLocationsByContent(52);
              $this->locationHandler->loadLocationsByContent(52);
              $this->locationHandler->loadLocationsByContent(52);
      
              $this->locationHandler->loadSubtreeIds(2);
              $this->locationHandler->loadSubtreeIds(2);
              $this->locationHandler->loadSubtreeIds(2);
      
              return new Response(
                  '<html><body>Test Controller</body></html>'
              );
          }
      }
      

      routing.yml

      test:
          path: /test
          defaults: { _controller: AppBundle\Controller\TestController::testAction } 

      services.yml

       AppBundle\Controller\TestController:
          public: true
          arguments:
              - "@ezpublish.spi.persistence.cache.locationHandler"
      

      3. Using the dev environment access http://yourproject/test
      4. Click on web profiler toolbar cache information.

      Result
      Web profiler shows multiple calls for ez-content-locations-52 and ez-location-subtree-2 keys.

      Expected result
      Keys ez-content-locations-52 and ez-location-subtree-2 are retrieved only once.

      Designs

        Attachments

          Activity

            People

              Unassigned Unassigned
              mateusz.bieniek@ibexa.co Mateusz Bieniek
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: