Content Insights Tip #61 | Resolving the 2MB Body Limit Issue in Sitecore XM Cloud Experience Editor
Today, I encountered an issue while using the Experience Editor in Sitecore XM Cloud. We exceeded the 2MB body limit on a specific page, which caused the Experience Editor to throw the following error:
Connection to your rendering host https://xmcloud-instance/api/editing/render failed with the following error: The remote server returned an error: (413) Body exceeded 2mb limit.
Fortunately, there is a workaround for this problem. You can increase the maximum body size of the Editing host by configuring the render.ts file. Here's how you can do it:
- Locate the render.ts file in your SXA Starter, you can find it at:
packages/create-sitecore-jss/src/templates/nextjs/src/pages/api/editing/render.ts - Modify the body size limit configuration in this file.
Important note: Sitecore advises against using the Experience Editor in XM Cloud due to its high resource consumption, which can affect system performance for other users. It would recommend disabling the Experience Editor for now and wait for Sitecore to fully remove it from XM Cloud.
Until next time!