Re: Query about caching detail pages in OpenCms

Michael Emmerich via opencms-dev <[email protected]> Tue, 29 Jul 2025 07:53:08 +0200
Newsgroups gmane.comp.cms.opencms.devel
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--===============2817915900724081880==
Content-Type: multipart/alternative;
 boundary="------------S3vqMttTtVsfeqsR3lUG8r66"
Content-Language: en-US

This is a multi-part message in MIME format.
--------------S3vqMttTtVsfeqsR3lUG8r66
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hello Chema,

first of all, the Flex-Cache DOES work with detail pages and caches 
multiple variation of the formatter used in the detail container.

The steps you describe sound correct, so you should check the following:

- Are you testing this in the Offline project? The Flex-Cache is not 
used in the Offline-Project, only in the Online project. So you need to 
access your pages online to see if something in the cache statistics

- Even if you do not set any caching parameters to a jsp, it will be 
shown in the cache statistics with the key "never". So does your 
formatter jsp show up there?


Kind regards,

Michael






Am 23.07.25 um 15:05 schrieb Chema Saga via opencms-dev:
>
> Hi everyone,
>
> I have a question regarding page caching in OpenCms and would 
> appreciate your help.
>
> Context:
>
>  *
>
>     I have a detail page displaying a large list of documents.
>
>  *
>
>     It currently takes 4-5 seconds to load due to the data volume.
>
>  *
>
>     To optimize it, I tried caching it using the
>     |cache=container-element;locale;uri;params;| parameter in the JSP
>     /formatter/ properties.
>
>  *
>
>     However, no cache entry is generated
>
> My questions are:
>
>  1. Is it possible to cache detail pages using OpenCms FlexCache?
>  2. If so, what configuration or steps are required to ensure that
>     entries are actually stored and served from the cache?
>
> I’d appreciate any guidance, code examples, or links to relevant 
> documentation!
>
> Thanks in advance,
> Chema.
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> https://lists.opencms.org/mailman/listinfo/opencms-dev
>
>
>
-- 
Michael Emmerich

Alkacon Software GmbH & Co. KG - The OpenCms Experts
http://www.alkacon.com
http://www.opencms.org

--------------S3vqMttTtVsfeqsR3lUG8r66
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hello Chema,</p>
    <p>first of all, the Flex-Cache DOES work with detail pages and
      caches multiple variation of the formatter used in the detail
      container.</p>
    <p>The steps you describe sound correct, so you should check the
      following:</p>
    <p>- Are you testing this in the Offline project? The Flex-Cache is
      not used in the Offline-Project, only in the Online project. So
      you need to access your pages online to see if something in the
      cache statistics</p>
    <p>- Even if you do not set any caching parameters to a jsp, it will
      be shown in the cache statistics with the key "never". So does
      your formatter jsp show up there?</p>
    <p><br>
    </p>
    <p>Kind regards,</p>
    <p>Michael</p>
    <p><br>
    </p>
    <p><br>
    </p>
    <p><br>
    </p>
    <p><br>
    </p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">Am 23.07.25 um 15:05 schrieb Chema Saga
      via opencms-dev:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAMNyhijvbC7VApnXMAq8PjPs5cvoGUxZvxaHPvoBvbhCHZUMJw@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <p
style="margin:13.716px 0px;line-height:28.575px;font-family:quote-cjk-patch,Inter,system-ui,-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Roboto,&quot;Noto Sans&quot;,Ubuntu,Cantarell,&quot;Helvetica Neue&quot;,Oxygen,&quot;Open Sans&quot;,sans-serif"><font
            color="#000000">Hi everyone,</font></p>
        <p
style="margin:13.716px 0px;line-height:28.575px;font-family:quote-cjk-patch,Inter,system-ui,-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Roboto,&quot;Noto Sans&quot;,Ubuntu,Cantarell,&quot;Helvetica Neue&quot;,Oxygen,&quot;Open Sans&quot;,sans-serif"><font
            color="#000000">I have a question regarding page caching in
            OpenCms and would appreciate your help.</font></p>
        <p
style="margin:13.716px 0px;line-height:28.575px;font-family:quote-cjk-patch,Inter,system-ui,-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Roboto,&quot;Noto Sans&quot;,Ubuntu,Cantarell,&quot;Helvetica Neue&quot;,Oxygen,&quot;Open Sans&quot;,sans-serif"><span
            style="font-weight:600"><font color="#000000">Context:</font></span></p>
        <ul
style="margin:13.716px 0px;padding-left:27.432px;font-family:quote-cjk-patch,Inter,system-ui,-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Roboto,&quot;Noto Sans&quot;,Ubuntu,Cantarell,&quot;Helvetica Neue&quot;,Oxygen,&quot;Open Sans&quot;,sans-serif">
          <li style="margin-left:15px">
            <p style="margin:0px;line-height:28.575px"><font
                color="#000000">I have a detail page displaying a large
                list of documents.</font></p>
          </li>
          <li style="margin-left:15px">
            <p style="margin:0px;line-height:28.575px"><span
                style="color:rgb(0,0,0)">It currently takes </span><span
                style="color:rgb(0,0,0);font-weight:600">4-5 seconds</span><span
                style="color:rgb(0,0,0)"> to load due to the data
                volume.</span></p>
          </li>
          <li style="margin-left:15px;margin-top:4px">
            <p style="margin:0px;line-height:28.575px"><font
                color="#000000">To optimize it, I tried caching it using
                the <code
style="font-family:Menlo,&quot;Roboto Mono&quot;,&quot;Courier New&quot;,Courier,monospace,Inter,sans-serif;background-color:rgb(236,236,236);border-radius:4px;padding:0.15rem 0.3rem">cache=container-element;locale;uri;params;</code> parameter
                in the JSP <em>formatter</em> properties.</font></p>
          </li>
          <li style="margin-left:15px;margin-top:4px">
            <p style="margin:0px;line-height:28.575px"><font
                color="#000000">However, <span style="font-weight:600">no
                  cache entry is generated</span> </font></p>
          </li>
        </ul>
        <p
style="margin:13.716px 0px;line-height:28.575px;font-family:quote-cjk-patch,Inter,system-ui,-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Roboto,&quot;Noto Sans&quot;,Ubuntu,Cantarell,&quot;Helvetica Neue&quot;,Oxygen,&quot;Open Sans&quot;,sans-serif"><span
            style="font-weight:600"><font color="#000000">My questions
              are:</font></span></p>
        <ol>
          <li style="margin-left:15px"><font color="#000000">Is it
              possible to cache detail pages using OpenCms FlexCache?</font></li>
          <li style="margin-left:15px"><font color="#000000">If so, what
              configuration or steps are required to ensure that entries
              are actually stored and served from the cache?</font></li>
        </ol>
        <font color="#000000"><span style="font-weight:600"></span></font>
        <p
style="margin:13.716px 0px;line-height:28.575px;font-family:quote-cjk-patch,Inter,system-ui,-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Roboto,&quot;Noto Sans&quot;,Ubuntu,Cantarell,&quot;Helvetica Neue&quot;,Oxygen,&quot;Open Sans&quot;,sans-serif"><font
            color="#000000">I’d appreciate any guidance, code examples,
            or links to relevant documentation!</font></p>
        Thanks in advance,<br>
        Chema.</div>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre wrap="" class="moz-quote-pre">_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
<a class="moz-txt-link-freetext"
      href="https://lists.opencms.org/mailman/listinfo/opencms-dev">https://lists.opencms.org/mailman/listinfo/opencms-dev</a>



</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Michael Emmerich

Alkacon Software GmbH &amp; Co. KG - The OpenCms Experts
<a class="moz-txt-link-freetext" href="http://www.alkacon.com">http://www.alkacon.com</a>
<a class="moz-txt-link-freetext" href="http://www.opencms.org">http://www.opencms.org</a>

</pre>
  </body>
</html>

--------------S3vqMttTtVsfeqsR3lUG8r66--

--===============2817915900724081880==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KVGhpcyBtYWls
IGlzIHNlbnQgdG8geW91IGZyb20gdGhlIG9wZW5jbXMtZGV2IG1haWxpbmcgbGlzdApUbyBjaGFu
Z2UgeW91ciBsaXN0IG9wdGlvbnMsIG9yIHRvIHVuc3Vic2NyaWJlIGZyb20gdGhlIGxpc3QsIHBs
ZWFzZSB2aXNpdApodHRwczovL2xpc3RzLm9wZW5jbXMub3JnL21haWxtYW4vbGlzdGluZm8vb3Bl
bmNtcy1kZXYKCgoK

--===============2817915900724081880==--