Skip to content

Commit e4b8be2

Browse files
committed
chore: update docs + rename sandbox template file
Signed-off-by: Frederik Bußmann <frederik@bussmann.io>
1 parent b273c5b commit e4b8be2

3 files changed

Lines changed: 23 additions & 5 deletions

File tree

docs/content/2.essentials/2.configuration.md

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,18 @@ Configure one or both API clients:
169169
Default cache configuration for the client
170170
:::
171171

172+
:::field{name="cache.client" type="object | boolean"}
173+
Cache configuration for client-side requests - default: in-memory LRU cache with 10 second TTL
174+
:::
175+
176+
:::field{name="cache.proxy" type="object | string | boolean"}
177+
Cache configuration for proxied requests - default: in-memory LRU cache with 10 second TTL
178+
:::
179+
180+
:::field{name="cache.options" type="object"}
181+
Named cache options to use in your application (e.g., `short`, `long`) - default: `short` (10 second TTL) and `long` (1 day TTL)
182+
:::
183+
172184
:::field{name="headers" type="object"}
173185
Additional headers to include in requests
174186
:::
@@ -282,10 +294,16 @@ export default defineNuxtConfig({
282294
},
283295
},
284296
cache: {
285-
max: 1000,
286-
maxSize: 1024 * 1024,
287-
maxEntrySize: 100 * 1024,
288-
ttl: 1000 * 60 * 60,
297+
client: {
298+
ttl: 1000 * 10,
299+
},
300+
proxy: {
301+
driver: 'lru-cache',
302+
},
303+
options: {
304+
short: { maxAge: 1, staleMaxAge: 9, swr: true },
305+
long: { maxAge: 3600, staleMaxAge: 82800, swr: true },
306+
},
289307
},
290308
headers: {},
291309
documents: [],

src/utils/sandbox.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { z } from 'zod'
1010
import { createClient } from '../runtime/utils/client'
1111
import { createStorefrontConfig } from '../runtime/utils/clients/storefront'
1212
import { createAdminConfig } from '../runtime/utils/clients/admin'
13-
import getSandboxTemplate from '../templates/sandbox-template'
13+
import getSandboxTemplate from '../templates/sandbox'
1414

1515
function getSandboxUrl(nuxt: Nuxt, clientType: ShopifyClientType): string {
1616
const url = new URL(nuxt.options.devServer.url)

0 commit comments

Comments
 (0)