Experience Edge for XM best practices
The recommended practices in this topic can help you work with Experience Edge for XM more efficiently.
Do not put global data in the Layout Service output for pages
If you put global data in the Layout Service output for pages, a data change requires a republication. For example, navigation data used in page headers and footers. Consider using GraphQL calls from your Rendering Host to get this data instead.
Use the Preview endpoint for local development
Use the Preview endpoint on a local or self-hosted Sitecore XM instance for local development. Use Experience Edge Delivery (and the required Connector) for testing, staging, and production. You can also use a test or staging environment as a shared front-end development environment.
Use API tools to proxy queries
If you are concerned about public access to sensitive data queries, use serverless functions, Next.js API routes, or other API tools to proxy queries to Experience Edge rather than invoking them directly from the browser (and exposing an API Token in the process).