<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Sling Model Caching in Adobe Experience Manager Questions</title>
    <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/sling-model-caching/m-p/437949#M125040</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;LI-USER uid="17509146"&gt;&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;What is the exact use case you have where you want to implement Sling model caching?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As per Sling documentation, By default, Sling Models do not do any caching of the adaptation result and every request for a model class will result in a new instance of the model class.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In general, it is strongly discouraged to store a reference to the original adaptable using the self injector. Using implementation version 1.4.8 or below, storing the original adaptable in a Sling Model, can cause heap space exhaustion, crashing the JVM. Starting in version 1.4.10, storing the original adaptable will not crash the JVM, but it can cause unexpected behavior (e.g. a model being created twice, when it should be cached). The issue was first reported in SLING-7586.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;More details here:&lt;BR /&gt;&lt;A href="https://sling.apache.org/documentation/bundles/models.html#caching" target="_blank"&gt;https://sling.apache.org/documentation/bundles/models.html#caching&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/sling-models-caching-use-case-amp-amp-how-to-invalidate-sling/td-p/357530" target="_blank"&gt;https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/sling-models-caching-use-case-amp-amp-how-to-invalidate-sling/td-p/357530&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/adobe/asset-share-commons/issues/177" target="_blank"&gt;https://github.com/adobe/asset-share-commons/issues/177&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also here you do not have invalidate the cache as it's not cached in dispatcher.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Fri, 21 Jan 2022 15:35:05 GMT</pubDate>
    <dc:creator>Asutosh_Jena_</dc:creator>
    <dc:date>2022-01-21T15:35:05Z</dc:date>
    <item>
      <title>Sling Model Caching</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/sling-model-caching/m-p/437939#M125039</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to implement sling model caching in my project. I wanted to understand where the cached models are stored? Is there any specific dispatcher configuration required to implement sling model caching? Can we set a TTL for the cached models?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jan 2022 14:05:41 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/sling-model-caching/m-p/437939#M125039</guid>
      <dc:creator>H_Malhotra</dc:creator>
      <dc:date>2022-01-21T14:05:41Z</dc:date>
    </item>
    <item>
      <title>Re: Sling Model Caching</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/sling-model-caching/m-p/437949#M125040</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;LI-USER uid="17509146"&gt;&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;What is the exact use case you have where you want to implement Sling model caching?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As per Sling documentation, By default, Sling Models do not do any caching of the adaptation result and every request for a model class will result in a new instance of the model class.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In general, it is strongly discouraged to store a reference to the original adaptable using the self injector. Using implementation version 1.4.8 or below, storing the original adaptable in a Sling Model, can cause heap space exhaustion, crashing the JVM. Starting in version 1.4.10, storing the original adaptable will not crash the JVM, but it can cause unexpected behavior (e.g. a model being created twice, when it should be cached). The issue was first reported in SLING-7586.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;More details here:&lt;BR /&gt;&lt;A href="https://sling.apache.org/documentation/bundles/models.html#caching" target="_blank"&gt;https://sling.apache.org/documentation/bundles/models.html#caching&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/sling-models-caching-use-case-amp-amp-how-to-invalidate-sling/td-p/357530" target="_blank"&gt;https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/sling-models-caching-use-case-amp-amp-how-to-invalidate-sling/td-p/357530&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/adobe/asset-share-commons/issues/177" target="_blank"&gt;https://github.com/adobe/asset-share-commons/issues/177&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also here you do not have invalidate the cache as it's not cached in dispatcher.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jan 2022 15:35:05 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/sling-model-caching/m-p/437949#M125040</guid>
      <dc:creator>Asutosh_Jena_</dc:creator>
      <dc:date>2022-01-21T15:35:05Z</dc:date>
    </item>
  </channel>
</rss>

