---
title: "How caching works in the Storefront client"
canonical_url: "https://shop-template.nuxt.dev/blogs/news/caching-in-the-storefront-client"
---
# How caching works in the Storefront client

Published on 2026-08-11 by Nuxt UI.

Catalogue data rarely changes between two visits, so the template caches most Storefront API requests. Each `useStorefrontData` call picks how with its `cache` option.

## Presets

The option names a preset, and Nuxt Shopify ships two:

* `long` stays fresh for an hour, then keeps being served for up to 23 more hours while a fresh copy loads in the background.
* `short` stays fresh for one second and can be served stale for nine more.

The template uses `long` for collections, products, menus, pages and articles, and `short` for search results. Cart and account requests don't go through this cache at all. You can change the presets or add your own under `cache.presets` in the Storefront client options.

## On the server

During server rendering, Nuxt Shopify stores responses in Nitro storage through Hydrogen's `createFetchWithCache`. The cache key is the query, its variables and the preset. Cookies, the visitor's language header and IP are removed from the request first, so one cached response serves every visitor. Only successful responses are stored, and mutations are never cached.

The default storage is an in-memory LRU cache of 32 MB. On a platform that runs several instances, point `cache.server` at a shared Nitro storage like Redis so they all reuse the same entries.

## In the browser

During client side navigation, responses are kept in memory for the full lifetime of their preset, so going back to a page you already visited doesn't refetch its data. When the browser and the server need different presets, pass an object like `{ browser: 'short', server: 'long' }` instead of a name.

## Sitemap

See the full [sitemap](https://shop-template.nuxt.dev/sitemap.md) for all pages.
