About Warmup Data

Warmup data is used to optimize page rendering when your site's pages are rendered on both the server and the client, ensuring that costly data operations are done only once.

Generally, the server executes data operations faster than the browser. With warmup data, you can pass the results of your server operations to your client-side code. During client-side rendering, you can write code to check if those operations were already done and set to warmup data, and if the warmup data exists, use it in your code. This prevents the client from performing the same expensive operations again.

Use the Rendering API to check whether your code is being run on the client or the server, and the Warmup Data API to set and get the warmup data.

Supported IDEs

You can optimize page rendering with warmupData using:

Client-side rendering

When working with warmup data it's important to keep in mind that there may be be cases where client-side rendering happens before server-side rendering. In such cases, you can't rely on the warmup data being set on the server, and need to execute those operations directly on the client-side.

Note that you can only perform the following operations on the client-side:

  • Accessing the browser's storage 
  • Using 3rd-party analytics
  • Creating dynamic event handlers 
  • Retrieving information about the client's browser
  • Navigating to another page

See also

Did this help?