Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Commit

Permalink
Set cache tags on SSR
Browse files Browse the repository at this point in the history
For some reason the tag is not being set when onMounted.
  • Loading branch information
bensinca authored Sep 5, 2023
1 parent 12acb91 commit 0a356a2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pages/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ import {
useContext,
onMounted,
useFetch,
onServerPrefetch
} from '@nuxtjs/composition-api';
import LazyHydrate from 'vue-lazy-hydration';
import { useCache, CacheTagPrefix } from '@vue-storefront/cache';
Expand Down Expand Up @@ -204,7 +205,7 @@ export default defineComponent({
page.value = await loadPage({ identifier: 'home' });
});
onMounted(() => {
onServerPrefetch(() => {
addTags([{ prefix: CacheTagPrefix.View, value: 'home' }]);
});
Expand Down

0 comments on commit 0a356a2

Please sign in to comment.