If you are getting slow performance on your Experience Editor locally, you are probably running out of resources in your docker container. By default, docker gives your container 1gb RAM and shares the host CPU. On your CM container, the 1gb limit is easily hit.
You can give it more by modifying your docker-compose-override.yml
file. Find your cm
container definition and add the following lines:
cm:
image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-xmcloud-cm:${VERSION:-latest}
build:
context: ./docker/build/cm
args:
PARENT_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xmcloud-cm:${SITECORE_VERSION}
TOOLS_IMAGE: ${TOOLS_IMAGE}
# **** ADD THESE LINES ****
deploy:
resources:
limits:
cpus: 1.0 # <--- gives it a dedicated core
memory: 6GB # <--- set this to a reasonable limit based on your machine specs.
# **** ADD THESE LINES ****
volumes:
- ${LOCAL_DEPLOY_PATH}\platform:C:\deploy
- ${LOCAL_DATA_PATH}\cm:C:\inetpub\wwwroot\App_Data\logs
- ${HOST_LICENSE_FOLDER}:c:\license
environment:
SITECORE_LICENSE_LOCATION: c:\license\license.xml
RENDERING_HOST_INTERNAL_URI: "http://rendering:3000"
JSS_DEPLOYMENT_SECRET_xmcloudpreview: ${JSS_DEPLOYMENT_SECRET_xmcloudpreview}
SITECORE_JSS_EDITING_SECRET: ${JSS_EDITING_SECRET}
SITECORE_EDITING_HOST_PUBLIC_HOST: "${RENDERING_HOST}"
SITECORE_Pages_Client_Host: ${SITECORE_Pages_Client_Host}
SITECORE_Pages_CORS_Allowed_Origins: ${SITECORE_Pages_CORS_Allowed_Origins}
# ADD THIS LINE
SITECORE_GRAPHQL_CORS: ${SITECORE_GRAPHQL_CORS}
# Development Environment Optimizations
SITECORE_DEVELOPMENT_PATCHES: DevEnvOn,CustomErrorsOff,DebugOn,DiagnosticsOff,InitMessagesOff
Sitecore_AppSettings_exmEnabled:define: "no" # remove to turn on EXM
entrypoint: powershell -Command "& C:/tools/entrypoints/iis/Development.ps1"
This should make your CE and EE run better locally. Also, you can now use Pages to edit your content locally. To do this you need to:
- Visit https://pages.sitecorecloud.io in your browser
- Open the dev tools and add a new key to the local storage for that site
- Key
Sitecore.Pages.LocalXmCloudUrl
- Value:
https://xmcloudcm.localhost/
Reload the pages site and you should see your local site editable. If you get CORS issues, make sure these values are set in your .env
file:
SITECORE_Pages_Client_Host=https://pages.sitecorecloud.io
SITECORE_Pages_CORS_Allowed_Origins=pages.sitecorecloud.io
SITECORE_GRAPHQL_CORS=*.sitecorecloud.io
Documentation for all this is here: https://doc.sitecore.com/xmc/en/developers/xm-cloud/connect-sitecore-pages-to-your-local-xm-cloud-instance.html