Tuesday, July 10, 2018

Sitecore Experience Commerce - Management.GetCommerceTerms and related methods in logs

Looking at the logs for a long running Sitecore Experience Commerce minion, I noticed large chunks of the following logs:
INFO Management.GetCommerceTerms./sitecore/Commerce/Commerce Control Panel/Commerce Engine Settings/Commerce Terms/BusinessTools/ViewPropertyNames|en
INFO Management.block.getitemsbypath./sitecore/Commerce/Commerce Control Panel/Commerce Engine Settings/Commerce Terms/BusinessTools/ViewPropertyNames|en
INFO Management.block.getitembyid.7f475f9d-341e-4a21-bec2-0f5f74987a3b: Language=en
It turns out that my minions environment (and the Habitat example) did not enable caching for queries related to management. For example the OOTB Habitat minions experience commerce environment (defined in PlugIn.Habitat.CommerceMinions-1.0.0.json) references a PolicySetId of Entity-PolicySet-MinionsMemoryCachePolicySet which in turn is defined in PlugIn.MinionsMemoryCache.PolicySet-1.0.0.json.

To allow caching of these management related queries, the following can be added to the PlugIn.MinionsMemoryCache.PolicySet-1.0.0.json file (or your own custom version).
  "@odata.type": "Sitecore.Commerce.Plugin.Management.ManagementCachePolicy, Sitecore.Commerce.Plugin.Management",
  "AllowCaching": true,
  "Expiration": 3600000
It may appear more cut-down than other caching examples, but worked in my environment.

Extract of a caching policy for a Sitecore Experience Commerce engine environment

No comments:

Post a Comment