Skip to main content

CacheLong

The CacheLong strategy instructs caches to store data for 1 hour, and staleWhileRevalidate data for an additional 23 hours. Note: these time values are subject to change.

Learn more about data fetching in Hydrogen.

Anchor to overrideOptions
overrideOptions

Examples
import {CacheLong} from '@shopify/hydrogen';

export async function loader({context}) {
const data = await context.storefront.query(
`#grahpql
{
shop {
name
description
}
}
`,
{
cache: CacheLong(),
},
);

return data;
}


Was this page helpful?