Skip to main content
Caching makes an integration faster and reduces unnecessary API traffic, but not every hotel API response has the same freshness requirements. Separate stable reference data from supplier-backed availability and booking state.

Autocomplete: 48 Hours

Cache only successful autocomplete responses. Normalize q by trimming whitespace and converting it to lowercase before building the key:
Keep city-scoped hotel searches separate from an unscoped query. The same text can return a different response when city_id is present. Debounce type-ahead requests and start after the minimum query length accepted by the endpoint.

Nationalities: 30 Days

For a typical guest form, request the default list with limit=250, cache the successful data.items, then filter the cached list locally. Use the pagination metadata only when more pages are available.
Use iso_code from the refreshed list for later shopping requests. Do not cache authentication, validation, or server-error responses.

Live Shopping and Checkout

A cache is a performance tool, not a reservation guarantee. Hotel prices, room options, and prebooking results can change as suppliers update availability.
  • For a customer-facing result page, use pricing_mode: "instant" and poll Get Search Price Updates every two seconds while results are visible.
  • Stop the polling loop when the refresh reports COMPLETE or EXPIRED.
  • Do not reuse an expired booking_token or prebooking ID. Restart from room options or hotel search when necessary.
  • Keep sandbox and production cache entries fully separate.
See retry behavior