Caching strategy
Rules for caching results at point of sale, including cache expiry and required cache-key parameters.
Introduction
For applications that use Thrust Carbon at Point of Sale (PoS), we allow caching of results. This brings two major benefits:
- Improved response times since you will not need to contact the Thrust Carbon system for results
- Reduction in outbound requests to the Thrust Carbon system
Please note: we do not allow caching for any reason other than Point of Sale (PoS); please speak to your Thrust Carbon account manager if you are unsure if your application falls within the Point of Sale allowance.
Cache Expiry
The maximum cache expiry is 7 days, and this applies for all segment types. If you set an expiry any longer than this, then the calculations may become out of date.
Cache Keys
Please make sure your cache key includes each parameter that you are passing in the segment payload. This includes all segment data (listed are examples, not an exhaustive list):
- Segment type
- Emitted at
- Origin/destination
- Travel class
- Number of passengers
- Number of days/nights/distance/duration
- Price of travel (price may not be relevant for air segments)
- Methodology requested
- Carrier/vendor
- Equipment type/carrier
Listed are values that are not included in the calculation, and can be omitted from the cache key:
- Metadata
- Grouping data
- Traveller ref
- Record locator
Air Cache Keys
An example cache key for air segments could include the following parameters:
- Segment type
- Emitted at
- Origin & destination IATA codes
- Travel class
- Flight number
- Carrier
- Equipment type
- Number of passengers
If you are using our calculation configuration, then you will also need to include the following parameters:
- Radiative forcing config
- Well-to-tank config
- Multi-methodology requested
Hotel Cache Keys
An example cache key for hotel segments could include the following parameters:
- Segment type
- Emitted at
- Hotel location
- This might be a property code, or it might be an address. If you are using multiple fields, then make sure you include all fields used in the cache key
- Number of nights
- Number of rooms