Hole punching full page cache on magento 2












4















I'm working in Magento 2 industry as a developer. I'm in a situation that i need to make a hole punching for a specific block.

The block contains the reviews got from Trustpilot. I use curl to call Trustpilot API. The thing is my review list on product page and the star for each product on category page are cached by full page cache. How can I make it isn't cached?

I read this article about creating a hole punching by using identities https://trellis.co/blog/magento2-fpc-hole-punching/. But my Trustpilot extension didn't use model to store the reviews (Every time I called API directly to fetch new review)

Does anyone have any advice for my situation? Should I keep fetching the reviews directly by using Trustpilot API? Or I should I do it another way?
Thanks










share|improve this question
















bumped to the homepage by Community 11 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.




















    4















    I'm working in Magento 2 industry as a developer. I'm in a situation that i need to make a hole punching for a specific block.

    The block contains the reviews got from Trustpilot. I use curl to call Trustpilot API. The thing is my review list on product page and the star for each product on category page are cached by full page cache. How can I make it isn't cached?

    I read this article about creating a hole punching by using identities https://trellis.co/blog/magento2-fpc-hole-punching/. But my Trustpilot extension didn't use model to store the reviews (Every time I called API directly to fetch new review)

    Does anyone have any advice for my situation? Should I keep fetching the reviews directly by using Trustpilot API? Or I should I do it another way?
    Thanks










    share|improve this question
















    bumped to the homepage by Community 11 mins ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      4












      4








      4








      I'm working in Magento 2 industry as a developer. I'm in a situation that i need to make a hole punching for a specific block.

      The block contains the reviews got from Trustpilot. I use curl to call Trustpilot API. The thing is my review list on product page and the star for each product on category page are cached by full page cache. How can I make it isn't cached?

      I read this article about creating a hole punching by using identities https://trellis.co/blog/magento2-fpc-hole-punching/. But my Trustpilot extension didn't use model to store the reviews (Every time I called API directly to fetch new review)

      Does anyone have any advice for my situation? Should I keep fetching the reviews directly by using Trustpilot API? Or I should I do it another way?
      Thanks










      share|improve this question
















      I'm working in Magento 2 industry as a developer. I'm in a situation that i need to make a hole punching for a specific block.

      The block contains the reviews got from Trustpilot. I use curl to call Trustpilot API. The thing is my review list on product page and the star for each product on category page are cached by full page cache. How can I make it isn't cached?

      I read this article about creating a hole punching by using identities https://trellis.co/blog/magento2-fpc-hole-punching/. But my Trustpilot extension didn't use model to store the reviews (Every time I called API directly to fetch new review)

      Does anyone have any advice for my situation? Should I keep fetching the reviews directly by using Trustpilot API? Or I should I do it another way?
      Thanks







      magento2 cache full-page-cache block-cache holepunching






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Feb 9 '18 at 7:56









      John

      661620




      661620










      asked Feb 7 '18 at 1:52









      thanhdv2811thanhdv2811

      434110




      434110





      bumped to the homepage by Community 11 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 11 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          1 Answer
          1






          active

          oldest

          votes


















          0














          The easiest way, in this case, is to use Ajax. I'm pretty sure this way will work as your expectation.



          One more thing, please avoiding use XML: cacheable=”false”.






          share|improve this answer



















          • 1





            Using cacheable=”false” affect entire page to cacheable false and its create issue for page performance.

            – Rakesh Jesadiya
            Feb 9 '18 at 8:33











          • @RakeshJesadiya as I said above please avoiding use XML: cacheable=”false”.

            – Khoa TruongDinh
            Feb 9 '18 at 9:15













          • Yes, I appreciate your quote, I just comment on why we don't need to use. I am not showing off your error.

            – Rakesh Jesadiya
            Feb 9 '18 at 9:23













          • Thank for your advice. But I still want to know how to create a hole punching full page cache for a block or a section on the page.

            – thanhdv2811
            Mar 1 '18 at 1:53











          • @thanhdv2811 I need time to investigate more about full page cache. I will be back and answer your question.

            – Khoa TruongDinh
            Mar 1 '18 at 2:39











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "479"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f212477%2fhole-punching-full-page-cache-on-magento-2%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          The easiest way, in this case, is to use Ajax. I'm pretty sure this way will work as your expectation.



          One more thing, please avoiding use XML: cacheable=”false”.






          share|improve this answer



















          • 1





            Using cacheable=”false” affect entire page to cacheable false and its create issue for page performance.

            – Rakesh Jesadiya
            Feb 9 '18 at 8:33











          • @RakeshJesadiya as I said above please avoiding use XML: cacheable=”false”.

            – Khoa TruongDinh
            Feb 9 '18 at 9:15













          • Yes, I appreciate your quote, I just comment on why we don't need to use. I am not showing off your error.

            – Rakesh Jesadiya
            Feb 9 '18 at 9:23













          • Thank for your advice. But I still want to know how to create a hole punching full page cache for a block or a section on the page.

            – thanhdv2811
            Mar 1 '18 at 1:53











          • @thanhdv2811 I need time to investigate more about full page cache. I will be back and answer your question.

            – Khoa TruongDinh
            Mar 1 '18 at 2:39
















          0














          The easiest way, in this case, is to use Ajax. I'm pretty sure this way will work as your expectation.



          One more thing, please avoiding use XML: cacheable=”false”.






          share|improve this answer



















          • 1





            Using cacheable=”false” affect entire page to cacheable false and its create issue for page performance.

            – Rakesh Jesadiya
            Feb 9 '18 at 8:33











          • @RakeshJesadiya as I said above please avoiding use XML: cacheable=”false”.

            – Khoa TruongDinh
            Feb 9 '18 at 9:15













          • Yes, I appreciate your quote, I just comment on why we don't need to use. I am not showing off your error.

            – Rakesh Jesadiya
            Feb 9 '18 at 9:23













          • Thank for your advice. But I still want to know how to create a hole punching full page cache for a block or a section on the page.

            – thanhdv2811
            Mar 1 '18 at 1:53











          • @thanhdv2811 I need time to investigate more about full page cache. I will be back and answer your question.

            – Khoa TruongDinh
            Mar 1 '18 at 2:39














          0












          0








          0







          The easiest way, in this case, is to use Ajax. I'm pretty sure this way will work as your expectation.



          One more thing, please avoiding use XML: cacheable=”false”.






          share|improve this answer













          The easiest way, in this case, is to use Ajax. I'm pretty sure this way will work as your expectation.



          One more thing, please avoiding use XML: cacheable=”false”.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Feb 7 '18 at 4:23









          Khoa TruongDinhKhoa TruongDinh

          21.7k64187




          21.7k64187








          • 1





            Using cacheable=”false” affect entire page to cacheable false and its create issue for page performance.

            – Rakesh Jesadiya
            Feb 9 '18 at 8:33











          • @RakeshJesadiya as I said above please avoiding use XML: cacheable=”false”.

            – Khoa TruongDinh
            Feb 9 '18 at 9:15













          • Yes, I appreciate your quote, I just comment on why we don't need to use. I am not showing off your error.

            – Rakesh Jesadiya
            Feb 9 '18 at 9:23













          • Thank for your advice. But I still want to know how to create a hole punching full page cache for a block or a section on the page.

            – thanhdv2811
            Mar 1 '18 at 1:53











          • @thanhdv2811 I need time to investigate more about full page cache. I will be back and answer your question.

            – Khoa TruongDinh
            Mar 1 '18 at 2:39














          • 1





            Using cacheable=”false” affect entire page to cacheable false and its create issue for page performance.

            – Rakesh Jesadiya
            Feb 9 '18 at 8:33











          • @RakeshJesadiya as I said above please avoiding use XML: cacheable=”false”.

            – Khoa TruongDinh
            Feb 9 '18 at 9:15













          • Yes, I appreciate your quote, I just comment on why we don't need to use. I am not showing off your error.

            – Rakesh Jesadiya
            Feb 9 '18 at 9:23













          • Thank for your advice. But I still want to know how to create a hole punching full page cache for a block or a section on the page.

            – thanhdv2811
            Mar 1 '18 at 1:53











          • @thanhdv2811 I need time to investigate more about full page cache. I will be back and answer your question.

            – Khoa TruongDinh
            Mar 1 '18 at 2:39








          1




          1





          Using cacheable=”false” affect entire page to cacheable false and its create issue for page performance.

          – Rakesh Jesadiya
          Feb 9 '18 at 8:33





          Using cacheable=”false” affect entire page to cacheable false and its create issue for page performance.

          – Rakesh Jesadiya
          Feb 9 '18 at 8:33













          @RakeshJesadiya as I said above please avoiding use XML: cacheable=”false”.

          – Khoa TruongDinh
          Feb 9 '18 at 9:15







          @RakeshJesadiya as I said above please avoiding use XML: cacheable=”false”.

          – Khoa TruongDinh
          Feb 9 '18 at 9:15















          Yes, I appreciate your quote, I just comment on why we don't need to use. I am not showing off your error.

          – Rakesh Jesadiya
          Feb 9 '18 at 9:23







          Yes, I appreciate your quote, I just comment on why we don't need to use. I am not showing off your error.

          – Rakesh Jesadiya
          Feb 9 '18 at 9:23















          Thank for your advice. But I still want to know how to create a hole punching full page cache for a block or a section on the page.

          – thanhdv2811
          Mar 1 '18 at 1:53





          Thank for your advice. But I still want to know how to create a hole punching full page cache for a block or a section on the page.

          – thanhdv2811
          Mar 1 '18 at 1:53













          @thanhdv2811 I need time to investigate more about full page cache. I will be back and answer your question.

          – Khoa TruongDinh
          Mar 1 '18 at 2:39





          @thanhdv2811 I need time to investigate more about full page cache. I will be back and answer your question.

          – Khoa TruongDinh
          Mar 1 '18 at 2:39


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Magento Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f212477%2fhole-punching-full-page-cache-on-magento-2%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Last logged in always never, not logging

          Colouring column values based on a specific condition. How could I do this?

          Iĥnotaksono