Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-23834

Cached ESI can not be shared among pages because of inner request

    Details

      Description

      Consider we have 2 pages, page1 and page2. Both have the same footer which is generated using:

      {{ render_esi( controller( "<controller>" )) }}
      

      Calling page1 and page2 after a siteaccess (e.g. "example.com/eng/page1/" and "example.com/eng/page2/") will generate different fragment URIs.

      Steps to reproduce:

      1. Create a common block that will be used in 2 different pages;
      2. Make a call to that block with: {{ render_esi( controller( "<controller>" )) }};
      3. Call page 1: example.com/eng/page1/

      GET /_fragment?_hash=iGReymaTGqldA%2F%2BFrsczq6Op5iA%3D&_path=serialized_siteaccess%3DO%253A38%253A%2522eZ%255CPublish%255CCore%255CMVC%255CSymfony%255CSiteAccess%2522%253A3%253A%257Bs%253A4%253A%2522name%2522%253Bs%253A3%253A%2522eng%2522%253Bs%253A12%253A%2522matchingType%2522%253Bs%253A11%253A%2522uri%253Aelement%2522%253Bs%253A7%253A%2522matcher%2522%253BO%253A57%253A%2522eZ%255CPublish%255CCore%255CMVC%255CSymfony%255CSiteAccess%255CMatcher%255CURIElement%2522%253A2%253A%257Bs%253A66%253A%2522%2500eZ%255CPublish%255CCore%255CMVC%255CSymfony%255CSiteAccess%255CMatcher%255CURIElement%2500request%2522%253BO%253A53%253A%2522eZ%255CPublish%255CCore%255CMVC%255CSymfony%255CRouting%255CSimplifiedRequest%2522%253A7%253A%257Bs%253A9%253A%2522%2500%252A%2500scheme%2522%253Bs%253A4%253A%2522http%2522%253Bs%253A7%253A%2522%2500%252A%2500host%2522%253Bs%253A12%253A%252253ezdemo.com%2522%253Bs%253A7%253A%2522%2500%252A%2500port%2522%253Bi%253A80%253Bs%253A11%253A%2522%2500%252A%2500pathinfo%2522%253Bs%253A17%253A%2522%252Feng%252F13011%252Fpage1%252F%2522%253Bs%253A14%253A%2522%2500%252A%2500queryParams%2522%253Ba%253A0%253A%257B%257Ds%253A12%253A%2522%2500%252A%2500languages%2522%253Ba%253A3%253A%257Bi%253A0%253Bs%253A5%253A%2522en_US%2522%253Bi%253A1%253Bs%253A2%253A%2522en%2522%253Bi%253A2%253Bs%253A2%253A%2522pt%2522%253B%257Ds%253A10%253A%2522%2500%252A%2500headers%2522%253Ba%253A0%253A%257B%257D%257Ds%253A72%253A%2522%2500eZ%255CPublish%255CCore%255CMVC%255CSymfony%255CSiteAccess%255CMatcher%255CURIElement%2500elementNumber%2522%253Bi%253A1%253B%257D%257D%26_format%3Dhtml%26_locale%3Den_GB%26_controller%3DNunoTestBundle%253AIssueTests%253Atestcontroller: fresh
      

      4. Call page 2: example.com/eng/page2/

      GET /_fragment?_hash=ckcHW6YM9%2BT3GRvY%2FdzUqi9lEfw%3D&_path=serialized_siteaccess%3DO%253A38%253A%2522eZ%255CPublish%255CCore%255CMVC%255CSymfony%255CSiteAccess%2522%253A3%253A%257Bs%253A4%253A%2522name%2522%253Bs%253A3%253A%2522eng%2522%253Bs%253A12%253A%2522matchingType%2522%253Bs%253A11%253A%2522uri%253Aelement%2522%253Bs%253A7%253A%2522matcher%2522%253BO%253A57%253A%2522eZ%255CPublish%255CCore%255CMVC%255CSymfony%255CSiteAccess%255CMatcher%255CURIElement%2522%253A2%253A%257Bs%253A66%253A%2522%2500eZ%255CPublish%255CCore%255CMVC%255CSymfony%255CSiteAccess%255CMatcher%255CURIElement%2500request%2522%253BO%253A53%253A%2522eZ%255CPublish%255CCore%255CMVC%255CSymfony%255CRouting%255CSimplifiedRequest%2522%253A7%253A%257Bs%253A9%253A%2522%2500%252A%2500scheme%2522%253Bs%253A4%253A%2522http%2522%253Bs%253A7%253A%2522%2500%252A%2500host%2522%253Bs%253A12%253A%252253ezdemo.com%2522%253Bs%253A7%253A%2522%2500%252A%2500port%2522%253Bi%253A80%253Bs%253A11%253A%2522%2500%252A%2500pathinfo%2522%253Bs%253A17%253A%2522%252Feng%252F13011%252Fpage2%252F%2522%253Bs%253A14%253A%2522%2500%252A%2500queryParams%2522%253Ba%253A0%253A%257B%257Ds%253A12%253A%2522%2500%252A%2500languages%2522%253Ba%253A3%253A%257Bi%253A0%253Bs%253A5%253A%2522en_US%2522%253Bi%253A1%253Bs%253A2%253A%2522en%2522%253Bi%253A2%253Bs%253A2%253A%2522pt%2522%253B%257Ds%253A10%253A%2522%2500%252A%2500headers%2522%253Ba%253A0%253A%257B%257D%257Ds%253A72%253A%2522%2500eZ%255CPublish%255CCore%255CMVC%255CSymfony%255CSiteAccess%255CMatcher%255CURIElement%2500elementNumber%2522%253Bi%253A1%253B%257D%257D%26_format%3Dhtml%26_locale%3Den_GB%26_controller%3DNunoTestBundle%253AIssueTests%253Atestcontroller: fresh
      

      This seems to be a regression from EZP-21695.

        Issue Links

          Activity

          Hide
          Nuno Oliveira (Inactive) added a comment - - edited

          For reference, here is the specific code I used in my tests:

          # /Nuno/TestBundle/Resources/config/routing.yml
          nuno_test_13011_page1:
              pattern:  /13011/page1/
              defaults: { _controller: NunoTestBundle:IssueTests:page1 }
           
          nuno_test_13011_page2:
              pattern:  /13011/page2/
              defaults: { _controller: NunoTestBundle:IssueTests:page2 }
           
          # /Nuno/TestBundle/Controller/IssueTestsController.php
              public function page1Action()
              {
                  return $this->render(
                      'NunoTestBundle:Tests/13011:page1.html.twig',
                      array(
                          'page_name'		=> 'Page 1'
                      )
                  );
              }
              
              public function page2Action()
              {
                  return $this->render(
                      'NunoTestBundle:Tests/13011:page2.html.twig',
                      array(
                          'page_name'		=> 'Page 2'
                      )
                  );
              }
              
              public function testcontrollerAction( $locationId=2 )
              {
          		$response = new Response();
          		$response->setPublic();
          		$response->setSharedMaxAge(36000);
           
          		return $this->render(
          			"NunoTestBundle:Tests/13011:footer.html.twig",
          			array(),
          			$response
          		); 
              }
           
          # /Nuno/TestBundle/Resources/views/Tests/13011/page1.html.twig
          Got here: {{ page_name }}!
           
          {{ render_esi( controller( "NunoTestBundle:IssueTests:testcontroller" )) }}
           
          # /Nuno/TestBundle/Resources/views/Tests/13011/page2.html.twig
          Got here: {{ page_name }}!
           
          {{ render_esi( controller( "NunoTestBundle:IssueTests:testcontroller" )) }}
           
          # /Nuno/TestBundle/Resources/views/Tests/13011/footer.html.twig
          <div style="margin: 400px 0 0 0; padding: 5px; background-color: #667; color: white; font: 14px arial bold; text-align: center;">
          Copyright &copy; 2014 by Nuno Oliveira.
          </div>
          
          

          Then, called:

          http://53ezdemo.com/eng/13011/page1/
          http://53ezdemo.com/eng/13011/page2/

          Show
          Nuno Oliveira (Inactive) added a comment - - edited For reference, here is the specific code I used in my tests: # /Nuno/TestBundle/Resources/config/routing.yml nuno_test_13011_page1: pattern: /13011/page1/ defaults: { _controller: NunoTestBundle:IssueTests:page1 }   nuno_test_13011_page2: pattern: /13011/page2/ defaults: { _controller: NunoTestBundle:IssueTests:page2 }   # /Nuno/TestBundle/Controller/IssueTestsController.php public function page1Action() { return $this->render( 'NunoTestBundle:Tests/13011:page1.html.twig', array( 'page_name' => 'Page 1' ) ); } public function page2Action() { return $this->render( 'NunoTestBundle:Tests/13011:page2.html.twig', array( 'page_name' => 'Page 2' ) ); } public function testcontrollerAction( $locationId=2 ) { $response = new Response(); $response->setPublic(); $response->setSharedMaxAge(36000);   return $this->render( "NunoTestBundle:Tests/13011:footer.html.twig", array(), $response ); }   # /Nuno/TestBundle/Resources/views/Tests/13011/page1.html.twig Got here: {{ page_name }}!   {{ render_esi( controller( "NunoTestBundle:IssueTests:testcontroller" )) }}   # /Nuno/TestBundle/Resources/views/Tests/13011/page2.html.twig Got here: {{ page_name }}!   {{ render_esi( controller( "NunoTestBundle:IssueTests:testcontroller" )) }}   # /Nuno/TestBundle/Resources/views/Tests/13011/footer.html.twig <div style="margin: 400px 0 0 0; padding: 5px; background-color: #667; color: white; font: 14px arial bold; text-align: center;"> Copyright &copy; 2014 by Nuno Oliveira. </div> Then, called: http://53ezdemo.com/eng/13011/page1/ http://53ezdemo.com/eng/13011/page2/
          Hide
          Nuno Oliveira (Inactive) added a comment - - edited

          Note:

          When calling pages without siteaccess, no pathinfo information is generated and fragment URIs will be identical.

          Show
          Nuno Oliveira (Inactive) added a comment - - edited Note: When calling pages without siteaccess, no pathinfo information is generated and fragment URIs will be identical.
          Hide
          Paulo Lopes (Inactive) added a comment - - edited

          Mght be related to https://jira.ez.no/browse/EZP-22535 as well?

          Show
          Paulo Lopes (Inactive) added a comment - - edited Mght be related to https://jira.ez.no/browse/EZP-22535 as well?
          Hide
          Nuno Oliveira (Inactive) added a comment - - edited

          @Paulo: Initially, I though it was the same problem as the one from EZP-22535, but further investigation showed it's not. It's very similar, but not the same. It might be the case that resolving one issue will also resolve the other, but conceptually, they are different issues.

          Specifically, EZP-22535 refers to cached ESI not being shared across different siteaccesses, whereas this issue refers to cached ESI not being shared across different pages on the same siteaccess.

          Show
          Nuno Oliveira (Inactive) added a comment - - edited @Paulo: Initially, I though it was the same problem as the one from EZP-22535 , but further investigation showed it's not. It's very similar, but not the same. It might be the case that resolving one issue will also resolve the other, but conceptually, they are different issues. Specifically, EZP-22535 refers to cached ESI not being shared across different siteaccesses, whereas this issue refers to cached ESI not being shared across different pages on the same siteaccess.
          Show
          Jérôme Vieilledent (Inactive) added a comment - Forum topic: http://share.ez.no/forums/ez-publish-5-platform/cached-esi-can-not-be-shared-among-pages-again
          Show
          Jérôme Vieilledent (Inactive) added a comment - PR: https://github.com/ezsystems/ezpublish-kernel/pull/1140
          Show
          Jérôme Vieilledent (Inactive) added a comment - Fixed in master: https://github.com/ezsystems/ezpublish-kernel/commit/6f1ccb3123c89d2b3d63f4edf8897d015df00cfb
          Hide
          Jérôme Vieilledent (Inactive) added a comment -

          Tagged v2014.11.7 and v2014.07.3

          Show
          Jérôme Vieilledent (Inactive) added a comment - Tagged v2014.11.7 and v2014.07.3
          Hide
          Rui Silva (Inactive) added a comment -

          Tested and approved by QA

          Show
          Rui Silva (Inactive) added a comment - Tested and approved by QA

            People

            • Assignee:
              Unassigned
              Reporter:
              Nuno Oliveira (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: