Skip to main content

API variables - Preload

The preload option is only available for the API Variables action in Response.
Enabling this options allows you to pre-dispatch the API request during the Request phase, effectively parallelizing both the API request and request to the origin server.

The diagram below describes the request & response cycle. Image from Gyazo

  1. The user request reaches KurocoEdge
  2. KurocoEdge processes the request
  3. The processed request is sent to the origin server
  4. Origin server returns a response
  5. KurocoEdge processed the response
  6. The processed response is sent to the user
info

Refer to KurocoEdge system architecture for more detailed explanation.

When preload is not enabled, the API variable in Response will only dispatch the API request when the response from origin server reaches KurocoEdge. When preload is enabled, the API variable in Response will dispatch the API request as soon as the user request is processed in KurocoEdge without having to wait for the response from the origin server to reach KurocoEdge.

Image from Gyazo

This allows you to effectively parallelize otherwise sequential request and API request calls, improving the performance and reducing the cost of processing. Therefore it is recommended to enable this option whenever possible.

However, preload option is not always possible - in particular, if the request dispatched by API variables action in Response requires the data captured from the origin server response, which requires sequential execution of Request and Response. Preload needs to be disabled so that captured variables from the Request phase will be available in the Response phase.


Support

If you have any other questions, please contact us or check out Our Discord Community.