Domain Object Caching
Domain Object Caching
What is a Domain Object?
Domain objects are classes that represent a unique set of data. Typically in Cortex, domain objects are carts, shoppers, products, and so on. Domain objects are used in nearly all Cortex operations: getting products, logging in customers, adding to cart, and so on.
Benefits of Caching Domain Objects
Cortex can call into your back end system multiple times to retrieve domain objects during a single http request. Domain caching can greatly improve performance, as Cortex can retrieve the domain object from the cache instead of repeatedly retrieving it from your back end system. For efficiency, Cortex maintains a separate cache of domain objects for each request.
Will Domain Object Caching help?
Domain caching can help you when:
- Your resource is used in zoom requests - zooms have the potential to be expensive operations, as they can call your resource's domain object from your back end system multiple times. By implementing domain caching in your resource integration, you can eliminate these repeated calls.
- Multiple resources link to your resource - linking has the potential to be an expensive operation, as during the link phase the resource's domain object may be retrieved from the back end system multiple times. By implementing domain caching in your resource integration, you can eliminate these calls.
Domain caching won't help you when:
- Your resource is stand alone - If your resource is a stand alone resource, meaning it isn't used very much and other resource's are not linking to it, then caching your resource's domain object might not help you.