2

My Sitecore CD website in IIS is http://cd.my-website.com with a role as ContentDelivery. This site contains Sitecore and custom API code in Headless mode.

The React code for the JSS app is on a different website http://fe.my-website.com (No Sitecore). JSS App is connecting to the http://cd.my-website.com through Layout ServiceHost.

All sites are separate in IIS and also separate folders pointing to the same database on a local machine.

The sites are working fine except personalization. We have set some personalization based on custom rule and some OOB rules.

The personalization is not working when I access the site using the http://fe.my-website.com.

I checked very weird behavior for the below URL

http://cd.my-website.com/sitecore/api/layout/render/jss?item=%2Fenterprise&sc_lang=en&sc_apikey={ourAPIKey}

When it is accessed through the FE website, the Layout service is called as an Ajax request and it can be found in XHR under network in the developer toolbar. The site is not showing any personalization when called in this way. Even I set some very basic OOB Sitecore personalization like date or day or month.

In XHR, I can find the call to the layout service. When I checked the response, I didn't find any personalized content. When I opened the same URL in the browser (right-click and open in new tab), I can see all personalization applied correctly. The output is different than the Ajax request.

When I deployed the React code in Sitecore site under /dist/myproject/ and tried to access personalization worked fine (Integrated mode).

Edit 1:

Sitecore 9.1 initial release

License: xDB enabled

xDB settings: Default/No Change

2
  • Can you check if IIS sets any kind of caching settings on the Node.js app
    – Anastasiya
    Sep 10, 2020 at 18:08
  • Also make sure you are including cookie information when you call the cd LayoutService from your front-end site. The fetch() function doesn't do this by default.
    – Anastasiya
    Sep 24, 2020 at 14:39

0

Your Answer

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

Browse other questions tagged or ask your own question.