1

I am already using Sitecore cache in SXA. I am using it on site level. My question is if we have Sitecore cache on site level, do we need to add it on rendering level in Sitecore SXA?

I am using the below link for Sitecore cache :-

https://doc.sitecore.com/xp/en/developers/sxa/17/sitecore-experience-accelerator/set-sxa-caching-options.html#:~:text=Caching%20to%20improve%20performance.,a%20large%20amount%20of%20items.

2 Answers 2

3

This is as per your requirement, if you want caching globally then you can apply cache on rendering level but if you want caching to be applied on your site level only then you can have caching on site level only.

For ex - If you have 2 sites - Site A and Site B, so let's suppose you want header rendering to be cached Site level only then in this case apply caching on Site level using following -

  1. Navigate to sitecore/<tenant>/<site>/Presentation/Cache Settings and on the Home tab, click Component Cache Settings.

enter image description here

  1. Enter a name for the setting and click OK.

  2. In the Select Items dialog box, navigate to Layout/Renderings/Feature/Experience Accelerator, click the renderings for which you want this setting to apply, and use the arrow to move them to the Selected field.

enter image description here

  1. In the Caching section, select the caching options:

enter image description here

  1. Publish the task.

And you want CTA rendering to be cached globally then in this case apply caching on globally using following - To set caching options for a rendering globally:

  1. Navigate to sitecore/Layout/Renderings/Feature/Experience Accelerator and click the relevant rendering.

  2. In the Caching section, select the caching options for the navigation rendering to help improve website performance:

enter image description here

0

This is already mentioned in the links that you shared If you set the caching options for a rendering on a site level, this overrides the global caching settings in the rendering definition items. So the answer is it will override it on the rendering.

Also, Gaurav mentioned in his answer, that to do that on the site level, you need to create a component cache setting and here you will provide the name of the renderings to cache. So it will automatically get applied to the component rather than go onto the particular one.

Hope this answer your question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.