Skip to content

Commit cb01bf6

Browse files
committed
chore(template): add cache options
Signed-off-by: Frederik Bußmann <frederik@bussmann.io>
1 parent 7273e57 commit cb01bf6

8 files changed

Lines changed: 8 additions & 0 deletions

File tree

template/app/components/Footer.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const { data: localization } = await useStorefrontData(`localizations-${locale.v
2727
country: country.value,
2828
}),
2929
transform: data => data?.localization,
30+
cache: 'long',
3031
})
3132
3233
const getCountryLabel = (code: Locale) => {

template/app/components/Header.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const { data: items } = await useStorefrontData('main-menu', `#graphql
2424
? localePath(`/collection/${item.resource?.handle}`)
2525
: item.url ?? undefined,
2626
})) ?? [],
27+
cache: 'long',
2728
})
2829
</script>
2930

template/app/components/collection/Grid.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const { data: collections } = await useStorefrontData(`collections-${locale.valu
2222
country: country.value,
2323
}),
2424
transform: data => flattenConnection(data?.collections).filter(c => c.description),
25+
cache: 'long',
2526
})
2627
</script>
2728

template/app/components/collection/Slider.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ const { data: products } = await useStorefrontData(key, `#graphql
6969
country: country.value,
7070
}),
7171
transform: data => flattenConnection(data?.collection?.products),
72+
cache: 'long',
7273
})
7374
</script>
7475

template/app/pages/blog/[handle]/[article].vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const { data: blog } = await useStorefrontData(`article-${locale.value}-${handle
2828
article: article.value,
2929
},
3030
transform: data => data?.blog,
31+
cache: 'long',
3132
})
3233
3334
const articleData = computed(() => blog.value?.articleByHandle)

template/app/pages/blog/[handle]/index.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const { data: blog } = await useStorefrontData(`blog-${locale.value}-${handle.va
2121
handle: handle.value,
2222
},
2323
transform: data => data?.blog,
24+
cache: 'long',
2425
})
2526
</script>
2627

template/app/pages/collection/[handle].vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ const { data: collection, status } = await useStorefrontData(key, `#graphql
5555
})),
5656
transform: data => data?.collection,
5757
watch: [params],
58+
cache: 'long',
5859
})
5960
6061
useSeoMeta({

template/app/pages/product/[handle].vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const { data } = await useStorefrontData(`collection-${locale.value}-${handle.va
3131
language: language.value,
3232
country: country.value,
3333
}),
34+
cache: 'long',
3435
})
3536
3637
const product = computed(() => data.value?.product)

0 commit comments

Comments
 (0)