Skip to main content

CacheShort

The CacheShort strategy instructs caches to store data for 1 second, and staleWhileRevalidate data for an additional 9 seconds. Note: these time values are subject to change.

Learn more about data fetching in Hydrogen.

Anchor to overrideOptions
overrideOptions

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

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

return data;
}


Was this page helpful?