In a recent client's environment, running Sitecore 10.1.0 with SXA, we experienced an unusual issue when it came to publishing. Certain parts of the page, recently authored, would not be shown in the Content Delivery environment. When we viewed the same page in the CM environment via the web db, the page rendered as expected.
An author would create / edit a page in Experience Editor, add an SXA component, add a datasource to that component and save. The component would typically be in workflow, but this issue is not restricted to components in workflow.
Back in Content Editor the author would publish only the page that the component was added on. They would then approve the component's workflow and then publish the page and all sub items. However, after publishing the component and it's datasource would not appear on the page while viewing on the CD server. So what was happening?
It turns out that, after some sleuthing and working with Sitecore Support, that the problem was related to caching. And in particular, the clearing of the web[paths] cache upon publish. By default, the cache is set to
false, as shown below.
<setting name="Caching.CacheKeyIndexingEnabled.PathCache" value="false"/>
As part of your cache management strategy, you may have set it to true, as we had. This was only set to true on, you guessed it, the CD server.
As documented in the public reference number, 157425, the bug in question incorrectly clears when
Caching.CacheKeyIndexingEnabled.PathCache is set to
true. Therefore the simplest solution is setting it to
If you're experiencing something similar where components and / or their datasources are not displaying after a publish, have a look and see if this setting is set to