Order Content Caching
All requests for a specific order are processed by a single instance, known as the owner instance. You can use it to cache the order content within the Orchestrator instance.
When a request is received, the orchestrator fetches the order details from its cache. After processing the request, it updates the cache with the most recent snapshot of the order and then synchronizes these updates with the database.
The cache greatly decreases the time needed to load order content for processing requests but is exclusively used for POST requests. For GET requests, any instance can handle them because the database maintains the most current snapshot of the order content.
Orchestrator clears the caches in the following scenarios:
-
When an order reaches any of the final states (Complete, Canceled, or Withdrawn)
-
Orchestrator cache clear scheduler:
-
The orchestrator utilizes a scheduler that runs according to the cron expression provided in the
orchestratorCacheClearInterval
property. -
You can utilize this job to clear the cache at regular intervals.
-
This functionality is beneficial for handling long-running orders.
Note: Order content is only cached after the order reaches the Execution state. Before this state, the order content is managed directly from the database. -