To improve performance the rendering process is split in two when possible: once on the server and once in the browser. When that isn't possible, all rendering happens in the browser.
Because rendering can occur twice, it's preferred to perform time-consuming tasks only once, such as querying collections or working with the results of network requests from external sites. If possible, it's best to perform these operations on the server.
Requesting the warmup data from the server returns undefined
in the following situations:
Your page code must check for these scenarios and provide a fallback alternative for getting the data.
Use the warmupData
API and env
property of the Rendering API
to track when and where your code is running. This lets you selectively run parts of your code.
Notes:
To use the Warmup Data API, import warmupData
from the wix-window-frontend
module: