What you can cache and for how long, what you must never cache, and how to build safe cache keys.
Caching makes your integration faster and keeps you well below your
rate limit. But the API returns two very
different kinds of data. Reference data changes slowly and is safe to cache.
Live shopping and booking data (prices, offers, tokens, booking status) is
time-sensitive and must be fetched fresh.
Hotel suggestions depend on the suppliers enabled for your organization, so never
share this cache across organizations, and clear it when you change supplier
connections in the portal. Debounce type-ahead requests (200 to 300 ms) and
start at 3 characters; shorter queries return an empty list. Do not cache errors
or empty results from a failed call.
Request the full list once with limit=250, cache data.items, and filter it
locally in your guest form. Use the pagination metadata only if
data.meta.totalPages is above 1.
The server caches each destination’s filter payload for 24 hours and tells you
when it will be rebuilt in data.cached_until. Cache it until then. Counts
describe the catalogue, not live availability, so they are fine to cache. Request
exactly one of place_id or hotel_id.
Content comes from the Unifystays catalogue, never from a supplier call, and has
no price or availability. Cache it by hotel_id. The response does not say when
the content last changed, so pick an expiry that suits your product (a few hours
to a day is a good default). Photos are plain URLs; treat them as opaque.
A cache is a performance tool, not a reservation guarantee. Prices, room
options and prebook results change as suppliers update availability.
Search prices.price.amount is a supplier quote for one exact search
(dates, rooms, guests, nationality). A recent price is already a stored quote
at most about 3 hours old. Never use a stored price as a booking price. Poll
Search Price Updates every 2 seconds
while results are visible, and stop on COMPLETE or EXPIRED.
Room offers and booking_token. Request rooms again whenever the hotel,
dates, guest mix or nationality changes, and when a token expires. Do not
reuse a token from an earlier request.
Room and family IDs.unifystays_room_id and unifystays_family_id are
for display and grouping in the current search. A tmp_ ID is valid for that
search only, and a built ID can be retired later. Do not keep them as
long-lived keys.
prebooking_id and offer_id. Prebook when checkout starts. Repeating a
prebook with the same token returns the stored result and does not contact the
supplier, so it will not show a newer price. Get a new token for a fresh check.
Cancellation quotes. Request a new quote when the guest asks to cancel.
Booking status. Read it after booking, after cancelling, and when a
webhook arrives. A webhook payload is a snapshot; use data.object.version to
order events and read the booking when you need the latest state.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Unifystays API","colors":{"primary":"#0F766E","light":"#14B8A6","dark":"#134E4A"},"navbar":{"links":[{"href":"https://unifystays.com","label":"Portal"},{"href":"mailto:support@unifystays.com","label":"Support"}]},"contextual":{"options":["copy","download-spec","chatgpt","claude"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"unifystays","hasAudioNarration":false,"actualSubdomain":"unifystays","customDomains":["docs.unifystays.com"],"gitSource":{"type":"github","owner":"ronakonline","repo":"unifystay","deployBranch":"main","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":""},"chroma":{"latestBuiltDeploymentHistoryId":"6ae836724729f9837cf0d8e4","collectionId":"17105c7f-831f-4751-8445-71739bb329ae","liveDeploymentHistoryId":"6ae836724729f9837cf0d8e4","schemaVersion":"v3"},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6ae836724729f9837cf0d8e4","clientVersion":"0.0.4045","searchFilterCounts":[{"language":"default","tag":"API Reference","count":29},{"language":"default","tag":"Guides","count":10},{"language":"default","tag":"Bookings","count":8},{"language":"default","tag":"Search \u0026 hotels","count":7},{"language":"default","tag":"Webhook endpoints","count":7},{"language":"default","tag":"Build your integration","count":5},{"language":"default","tag":"Webhook logs","count":4},{"language":"default","tag":"Get started","count":3},{"language":"default","tag":"Destination \u0026 master data","count":2},{"language":"default","tag":"Operate","count":2}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"guides/caching-strategy","slug":"/guides/caching-strategy","pageMetadata":{"title":"Caching Strategy","description":"What you can cache and for how long, what you must never cache, and how to build safe cache keys.","href":"/guides/caching-strategy"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"What you can cache and for how long, what you must never cache, and how to build safe cache keys.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Caching makes your integration faster and keeps you well below your\n`,_jsx(_components.a,{href:`/api-reference/overview#rate-limits`,children:`rate limit`}),`. But the API returns two very\ndifferent kinds of data. `,_jsx(_components.strong,{children:`Reference data`}),` changes slowly and is safe to cache.\n`,_jsx(_components.strong,{children:`Live shopping and booking data`}),` (prices, offers, tokens, booking status) is\ntime-sensitive and must be fetched fresh.`]}),`\n`,_jsx(Heading,{level:`2`,id:`at-a-glance`,children:`At a glance`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Data`}),_jsx(_components.th,{children:`Cache?`}),_jsx(_components.th,{children:`For how long`}),_jsx(_components.th,{children:`Key it by`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`/api-reference/destination-autocomplete`,children:`Destination autocomplete`})}),_jsx(_components.td,{children:`Yes`}),_jsxs(_components.td,{children:[`Up to `,_jsx(_components.strong,{children:`48 hours`})]}),_jsxs(_components.td,{children:[`Environment, organization, enabled supplier set, trimmed lowercase `,_jsx(_components.code,{children:`q`}),`, `,_jsx(_components.code,{children:`types`}),`, `,_jsx(_components.code,{children:`limit`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`/api-reference/nationalities`,children:`Nationalities`})}),_jsx(_components.td,{children:`Yes`}),_jsxs(_components.td,{children:[`Up to `,_jsx(_components.strong,{children:`30 days`})]}),_jsxs(_components.td,{children:[`Environment, `,_jsx(_components.code,{children:`search`}),`, `,_jsx(_components.code,{children:`sort_by`}),`, `,_jsx(_components.code,{children:`sort_order`}),`, `,_jsx(_components.code,{children:`page`}),`, `,_jsx(_components.code,{children:`limit`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`/api-reference/hotel-filters`,children:`Hotel filters`})}),_jsx(_components.td,{children:`Yes`}),_jsxs(_components.td,{children:[`Until `,_jsx(_components.code,{children:`data.cached_until`}),` (the server rebuilds it every 24 hours)`]}),_jsxs(_components.td,{children:[`Environment and `,_jsx(_components.code,{children:`place_id`}),` or `,_jsx(_components.code,{children:`hotel_id`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`/api-reference/hotel-content`,children:`Hotel content`})}),_jsx(_components.td,{children:`Yes`}),_jsx(_components.td,{children:`Your choice. A few hours to a day is a sensible default`}),_jsxs(_components.td,{children:[`Environment and `,_jsx(_components.code,{children:`hotel_id`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Search results page`}),_jsx(_components.td,{children:`Only while the guest is on it`}),_jsxs(_components.td,{children:[`The life of the `,_jsx(_components.code,{children:`search_id`}),` (about 5 minutes)`]}),_jsx(_components.td,{children:_jsx(_components.code,{children:`search_id`})})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[`Search prices (`,_jsx(_components.code,{children:`price`}),`, `,_jsx(_components.code,{children:`supplier_prices`}),`)`]}),_jsx(_components.td,{children:_jsx(_components.strong,{children:`No`})}),_jsx(_components.td,{children:`Never reuse for a booking`}),_jsx(_components.td,{children:`n/a`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[`Room offers, `,_jsx(_components.code,{children:`booking_token`})]}),_jsx(_components.td,{children:_jsx(_components.strong,{children:`No`})}),_jsx(_components.td,{children:`Valid at most 15 minutes; never cache`}),_jsx(_components.td,{children:`n/a`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[`Prebook result, `,_jsx(_components.code,{children:`prebooking_id`})]}),_jsx(_components.td,{children:_jsx(_components.strong,{children:`No`})}),_jsx(_components.td,{children:`Single use; expires with the offer`}),_jsx(_components.td,{children:`n/a`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Cancellation quote`}),_jsx(_components.td,{children:_jsx(_components.strong,{children:`No`})}),_jsx(_components.td,{children:`5 minutes, single use`}),_jsx(_components.td,{children:`n/a`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Booking status and details`}),_jsx(_components.td,{children:_jsx(_components.strong,{children:`No`})}),_jsx(_components.td,{children:`Always read current state`}),_jsx(_components.td,{children:`n/a`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Webhook payloads`}),_jsx(_components.td,{children:`Store as a log`}),_jsx(_components.td,{children:`Events are snapshots, not the latest state`}),_jsxs(_components.td,{children:[`Event `,_jsx(_components.code,{children:`id`})]})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`cache-this`,children:`Cache this`}),`\n`,_jsx(Heading,{level:`3`,id:`autocomplete-up-to-48-hours`,children:`Autocomplete: up to 48 hours`}),`\n`,_jsxs(_components.p,{children:[`Cache only successful responses. Trim and lowercase `,_jsx(_components.code,{children:`q`}),` before building the key:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`environment + organization + enabled supplier set + normalized q + types + limit`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`Hotel suggestions depend on the suppliers enabled for your organization, so never\nshare this cache across organizations, and clear it when you change supplier\nconnections in the portal. Debounce type-ahead requests (200 to 300 ms) and\nstart at 3 characters; shorter queries return an empty list. Do not cache errors\nor empty results from a failed call.`}),`\n`,_jsx(Heading,{level:`3`,id:`nationalities-up-to-30-days`,children:`Nationalities: up to 30 days`}),`\n`,_jsxs(_components.p,{children:[`Request the full list once with `,_jsx(_components.code,{children:`limit=250`}),`, cache `,_jsx(_components.code,{children:`data.items`}),`, and filter it\nlocally in your guest form. Use the pagination metadata only if\n`,_jsx(_components.code,{children:`data.meta.totalPages`}),` is above 1.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`environment + search + sort_by + sort_order + page + limit`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`Send the `,_jsx(_components.code,{children:`iso_code`}),` from the refreshed list in later requests. Do not cache\nauthentication, validation or server-error responses.`]}),`\n`,_jsxs(Heading,{level:`3`,id:`hotel-filters-until-cached_until`,children:[`Hotel filters: until `,_jsx(_components.code,{children:`cached_until`})]}),`\n`,_jsxs(_components.p,{children:[`The server caches each destination’s filter payload for 24 hours and tells you\nwhen it will be rebuilt in `,_jsx(_components.code,{children:`data.cached_until`}),`. Cache it until then. Counts\ndescribe the catalogue, not live availability, so they are fine to cache. Request\nexactly one of `,_jsx(_components.code,{children:`place_id`}),` or `,_jsx(_components.code,{children:`hotel_id`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`hotel-content-your-own-expiry`,children:`Hotel content: your own expiry`}),`\n`,_jsxs(_components.p,{children:[`Content comes from the Unifystays catalogue, never from a supplier call, and has\nno price or availability. Cache it by `,_jsx(_components.code,{children:`hotel_id`}),`. The response does not say when\nthe content last changed, so pick an expiry that suits your product (a few hours\nto a day is a good default). Photos are plain URLs; treat them as opaque.`]}),`\n`,_jsx(Heading,{level:`2`,id:`never-cache-this`,children:`Never cache this`}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`A cache is a performance tool, not a reservation guarantee. Prices, room\noptions and prebook results change as suppliers update availability.`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Search prices.`}),` `,_jsx(_components.code,{children:`price.amount`}),` is a supplier quote for one exact search\n(dates, rooms, guests, nationality). A `,_jsx(_components.code,{children:`recent`}),` price is already a stored quote\nat most about 3 hours old. Never use a stored price as a booking price. Poll\n`,_jsx(_components.a,{href:`/api-reference/search-price-updates`,children:`Search Price Updates`}),` every 2 seconds\nwhile results are visible, and stop on `,_jsx(_components.code,{children:`COMPLETE`}),` or `,_jsx(_components.code,{children:`EXPIRED`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[`Room offers and `,_jsx(_components.code,{children:`booking_token`}),`.`]}),` Request rooms again whenever the hotel,\ndates, guest mix or nationality changes, and when a token expires. Do not\nreuse a token from an earlier request.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Room and family IDs.`}),` `,_jsx(_components.code,{children:`unifystays_room_id`}),` and `,_jsx(_components.code,{children:`unifystays_family_id`}),` are\nfor display and grouping in the current search. A `,_jsx(_components.code,{children:`tmp_`}),` ID is valid for that\nsearch only, and a built ID can be retired later. Do not keep them as\nlong-lived keys.`]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`prebooking_id`}),` and `,_jsx(_components.code,{children:`offer_id`}),`.`]}),` Prebook when checkout starts. Repeating a\nprebook with the same token returns the stored result and does not contact the\nsupplier, so it will not show a newer price. Get a new token for a fresh check.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Cancellation quotes.`}),` Request a new quote when the guest asks to cancel.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Booking status.`}),` Read it after booking, after cancelling, and when a\nwebhook arrives. A webhook payload is a snapshot; use `,_jsx(_components.code,{children:`data.object.version`}),` to\norder events and read the booking when you need the latest state.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`rules-that-apply-everywhere`,children:`Rules that apply everywhere`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Keep Sandbox and Production caches fully separate. IDs are\nenvironment-specific.`}),`\n`,_jsxs(_components.li,{children:[`Cache only successful responses (`,_jsx(_components.code,{children:`2xx`}),`). Never cache `,_jsx(_components.code,{children:`4xx`}),` or `,_jsx(_components.code,{children:`5xx`}),`.`]}),`\n`,_jsx(_components.li,{children:`Include in the key everything that changes the answer (for example\norganization and supplier set for autocomplete).`}),`\n`,_jsx(_components.li,{children:`Combine identical in-flight requests: one lookup per key, not one per user.`}),`\n`,_jsxs(_components.li,{children:[`On any `,_jsx(_components.code,{children:`404`}),` or expiry for a search, stream or token, discard the cached state\nand start the step again. See `,_jsx(_components.a,{href:`/errors#expired-and-used-values`,children:`Errors \u0026 Retries`}),`.`]}),`\n`]}),`\n`,_jsx(_components.p,{children:_jsx(_components.a,{href:`/guides/hotel-booking-flow#time-limits`,children:`See the full time limits`})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Caching Strategy","description":"What you can cache and for how long, what you must never cache, and how to build safe cache keys.","href":"/guides/caching-strategy"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"At a glance","slug":"at-a-glance","depth":2,"children":[]},{"title":"Cache this","slug":"cache-this","depth":2,"children":[{"title":"Autocomplete: up to 48 hours","slug":"autocomplete-up-to-48-hours","depth":3,"children":[]},{"title":"Nationalities: up to 30 days","slug":"nationalities-up-to-30-days","depth":3,"children":[]},{"title":"Hotel filters: until cached_until","slug":"hotel-filters-until-cached_until","depth":3,"children":[]},{"title":"Hotel content: your own expiry","slug":"hotel-content-your-own-expiry","depth":3,"children":[]}]},{"title":"Never cache this","slug":"never-cache-this","depth":2,"children":[]},{"title":"Rules that apply everywhere","slug":"rules-that-apply-everywhere","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"unifystays","siteName":"Unifystays API","title":"Caching Strategy - Unifystays API","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-08T16:56:41.387Z","originalFileLocation":"guides/caching-strategy.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"What you can cache and for how long, what you must never cache, and how to build safe cache keys.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Unifystays API\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/unifystays/_generated/favicon/apple-touch-icon.png?v=3\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/unifystays/_generated/favicon/favicon-32x32.png?v=3\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/unifystays/_generated/favicon/favicon-16x16.png?v=3\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/unifystays/_generated/favicon/favicon.ico?v=3\">\u003cmeta data-mint-head property=\"og:title\" content=\"Caching Strategy - Unifystays API\">\u003cmeta data-mint-head property=\"og:description\" content=\"What you can cache and for how long, what you must never cache, and how to build safe cache keys.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Unifystays API\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.unifystays.com/guides/caching-strategy\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://unifystays.mintlify.app/_mintlify/api/og/v2?division=Build+your+integration\u0026amp;title=Caching+Strategy\u0026amp;description=What+you+can+cache+and+for+how+long%2C+what+you+must+never+cache%2C+and+how+to+build+safe+cache+keys.\u0026amp;theme=8157bd32ddef625e2bd30aba\u0026amp;signature=19144a52eacbfdbf1528d1a64e429e6e34e2630183ba6703e639d39757185764\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Caching Strategy - Unifystays API\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"What you can cache and for how long, what you must never cache, and how to build safe cache keys.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://unifystays.mintlify.app/_mintlify/api/og/v2?division=Build+your+integration\u0026amp;title=Caching+Strategy\u0026amp;description=What+you+can+cache+and+for+how+long%2C+what+you+must+never+cache%2C+and+how+to+build+safe+cache+keys.\u0026amp;theme=8157bd32ddef625e2bd30aba\u0026amp;signature=19144a52eacbfdbf1528d1a64e429e6e34e2630183ba6703e639d39757185764\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"https://mintlify.s3.us-west-1.amazonaws.com/unifystays/_generated/favicon/browserconfig.xml?v=3\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Unifystays API\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0F766E\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.unifystays.com/guides/caching-strategy\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/guides/caching-strategy.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.unifystays.com/#organization\",\"name\":\"Unifystays API\",\"url\":\"https://docs.unifystays.com\"},{\"@type\":\"WebSite\",\"@id\":\"https://docs.unifystays.com#website\",\"name\":\"Unifystays API\",\"url\":\"https://docs.unifystays.com\",\"publisher\":{\"@id\":\"https://docs.unifystays.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.unifystays.com/guides/caching-strategy#webpage\",\"url\":\"https://docs.unifystays.com/guides/caching-strategy\",\"name\":\"Caching Strategy\",\"description\":\"What you can cache and for how long, what you must never cache, and how to build safe cache keys.\",\"dateModified\":\"2026-10-08T16:56:41.387Z\",\"isPartOf\":{\"@id\":\"https://docs.unifystays.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.unifystays.com/guides/caching-strategy#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.unifystays.com/guides/caching-strategy#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Build your integration\",\"item\":\"https://docs.unifystays.com/guides/hotel-booking-flow\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Caching Strategy\",\"item\":\"https://docs.unifystays.com/guides/caching-strategy\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.unifystays.com/guides/caching-strategy#article\",\"headline\":\"Caching Strategy\",\"name\":\"Caching Strategy\",\"description\":\"What you can cache and for how long, what you must never cache, and how to build safe cache keys.\",\"url\":\"https://docs.unifystays.com/guides/caching-strategy\",\"mainEntityOfPage\":{\"@id\":\"https://docs.unifystays.com/guides/caching-strategy#webpage\"},\"dateModified\":\"2026-10-08T16:56:41.387Z\",\"publisher\":{\"@id\":\"https://docs.unifystays.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.unifystays.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Unifystays API\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Unifystays API","nav":{"global":null,"tabs":[{"tab":"Guides","groups":[{"group":"Get started","pages":[{"title":"Introduction","href":""},{"title":"Quickstart","href":"/quickstart"},{"title":"Portal \u0026 Environments","href":"/guides/portal-and-environments"}]},{"group":"Build your integration","pages":[{"title":"Hotel Booking Flow","href":"/guides/hotel-booking-flow"},{"title":"IDs and Tokens Cheat Sheet","description":"Which identifiers and tokens to store, where each one comes from, how long it lasts, and which call needs it next.","href":"/guides/field-cheatsheet"},{"title":"Caching Strategy","href":"/guides/caching-strategy"},{"title":"Webhooks","description":"Receive booking events in real time, choose which events you get, verify them, handle retries and duplicates, and replay what you missed.","href":"/guides/webhooks"},{"title":"Verify Webhook Signatures","href":"/guides/verify-webhook-signatures"}]},{"group":"Operate","pages":[{"title":"Errors \u0026 Retries","href":"/errors"},{"title":"Launch Checklist","href":"/guides/launch-checklist"}]}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api-reference/overview"}]}]},"basePath":"","title":"Caching Strategy - Unifystays API","buildId":"dpl_36EDyZCDfRuoUD9af5CH4M1bqY2h","deploymentId":"dpl_36EDyZCDfRuoUD9af5CH4M1bqY2h","dynamics":[],"chunks":[]}