Nuxt-Module, that provides a system to set shopware cache-tags for later use in e.g. a full-page cache

Overview

nuxt-shopware-caching

Nuxt-Module, that provides a system to set shopware cache-tags for later use in e.g. a full-page cache.
This module is meant to be used together with the companion bundle for Shopware

Installation

  • NPM: npm install @mothership-gmbh/nuxt-shopware-caching
  • pnpm: pnpm install @mothership-gmbh/nuxt-shopware-caching
  • Yarn: yarn add @mothership-gmbh/nuxt-shopware-caching

Usage

Add the module

Add the module in your nuxt.config.js:

{
    modules: [
        "@mothership-gmbh/nuxt-shopware-caching/module"
    ]
}

Use the composable in your vue components

import { useCache } from "@mothership-gmbh/nuxt-shopware-caching"

export default {
    setup(props) {
        const {addProductCacheTag} = useCache();
        addProductCacheTag(props.productId);
    }
}

The module will then aggregate all cache tags on the page and attach them in a comma-separated list to the HTTP response as a X-Cache-Tags-header. Example HTTP-Response header:

X-Cache-Tags: topbar-route,base-navigation,navigation-route-e41d381d990346bebff2a736b7b12c5c,cms-page-da2ad0281b4d4fc4ae7c6f3a68700e59,product-5b5e2f24dced46cdba488c01b9c12130,product-1c150aab458940c28a30202abc404b96

Reference

composable useCache

export declare const useCache: () => {
    addCacheTag: (tag: string) => void;
    addProductCacheTag: (productId: string) => void;
    addProductListingCacheTag: (productId: string) => void;
    addCategoryCacheTag: (categoryId: string) => void;
    addNavigationRouteCacheTag: (categoryId: string) => void;
    addBaseNavigationCacheTag: () => void;
    addCmsPageCacheTag: (cmsPageId: string) => void;
    addLandingPageCacheTag: (landingPageId: string) => void;
};
You might also like...

🪅 Nuxt 3 module to connect with any API securely – server proxy & customizable composable names

nuxt-api-party This module provides composables to fetch data from an API of your choice securely. You can customize the composable names! Given json-

Dec 26, 2022

A modern, zero-dependency uptime monitoring tool & status page based on GitHub Actions & Nuxt Content v2.

A modern, zero-dependency uptime monitoring tool & status page based on GitHub Actions & Nuxt Content v2.

StatusBase Uptime monitoring tool & beautiful status pages Powered by Nuxt Content v2! Free • Open Source • Notification View Demo · Report Bug · Requ

Dec 27, 2022

A modern, zero-dependency uptime monitoring tool & status page based on GitHub Actions & Nuxt Content v2.

A modern, zero-dependency uptime monitoring tool & status page based on GitHub Actions & Nuxt Content v2.

StatusBase Uptime monitoring tool & beautiful status pages Powered by Nuxt Content v2! Free • Open Source • Notification View Demo · Report Bug · Requ

Jul 5, 2022

This repo contains a fully configured nuxt 3 instance supporting TypeScript and several considered as useful libraries, fully configured and ready to use in real world projects!

Nuxt 3 Starter This repo contains a fully configured nuxt 3 instance supporting TypeScript and several considered as useful libraries, fully configure

Dec 27, 2022

⚡️ Minimal GraphQL Client + Code Generation for Nuxt

nuxt-graphql-client ⚡️ Minimal GraphQL Client + Code Generation for Nuxt ⚡️ Minimal GraphQL Client + Code Generation for Nuxt Features Zero Configurat

Dec 27, 2022

Easily connect your Nuxt 3 application with LogSnag 📰

Easily connect your Nuxt 3 application with LogSnag 📰

Nuxt LogSnag 📰 LogSnag integration for Nuxt 3 ✨ Release Notes Features Nuxt 3 ready Easy integration Handy composables TypeScript support Setup Insta

Apr 28, 2022

Nuxt 3 starter with Algolia, Storyblok, and Indexer

Nuxt 3 with Storyblok CMS and Algolia Search (incl. automatic indexing) This is a demo repository for an article in Dev.to. We recommend to look at th

May 24, 2022

End-to-end typesafe APIs with tRPC.io in Nuxt applications.

End-to-end typesafe APIs with tRPC.io in Nuxt applications.

tRPC-Nuxt End-to-end typesafe APIs with tRPC.io in Nuxt applications. The client above is not importing any code from the server, only its type declar

Dec 30, 2022

Batteries-included, zero-config Ionic integration for Nuxt

Nuxt Ionic Ionic integration for Nuxt ✨ Changelog 📖 Read the documentation ▶️ Online playground Features ⚠️ nuxt-ionic is currently a work in progres

Dec 28, 2022
Owner
Mothership GmbH
E-Commerce Agentur aus München
Mothership GmbH
Easy generation of OpenGraph & Twitter meta-tags in Nuxt 3 📋

nuxt-social-tags Easy generation of OpenGraph & Twitter meta-tags in Nuxt 3 ✨ Release Notes ?? Read the documentation Features Nuxt3 ready Composables

Conner 19 Dec 17, 2022
Nuxt.js module to use Unleash toggle feature services

nuxt-unleash Nuxt.js module to use Unleash toggle feature services ?? Release Notes Features Use $unleash to access and handle your Unleash feature fl

Juanjo Conejero 15 Dec 3, 2022
🔎 Algolia module for Nuxt

@nuxtjs/algolia Algolia module for Nuxt ✨ Release Notes ?? Read the documentation Features Nuxt 3 ready Easy integration with Algolia Handy composable

Nuxt Community 128 Jan 7, 2023
Nuxt 3 module for Kirby's Query Language API

nuxt-kql Kirby KQL module for Nuxt 3. This module provides a useKql composable, which under the hood uses useFetch. Thus, KQL query fetching in your N

Johann Schopplich 25 Dec 15, 2022
Nuxt 3 module for Web3.js

nuxt-web3.js Nuxt 3 module for Web3.js. Installation npm install nuxt-web3.js Usage export default defineNuxtConfig({ modules: ['nuxt-web3.js'], })

Robert Soriano 8 Dec 16, 2022
OpenID-Connect(OIDC) integration module for nuxt 3.0.

Nuxt OpenID-Connect OpenID-Connect(OIDC) integration module for nuxt 3.0. Features An Nuxt 3 module. OIDC integration ( implemetation base openid-clie

Aborn Jiang 10 Dec 24, 2022
🔎 Meilisearch module for Nuxt 3

nuxt-meilisearch Meilisearch module for Nuxt Features Nuxt 3 Easy integration with MeilisearchJS lib Support for Vue Algolia Vue 3 InstantSearch compo

Alex Duval 50 Dec 26, 2022
✉️ Nuxt module for first class integration with popular newsletter providers

nuxt-newsletter Newsletter module for Nuxt 3 ✨ Release Notes ?? Read the documentation Features Nuxt 3 ready Easy integration with Mailchimp, Revue, B

Jakub Andrzejewski 39 Jan 5, 2023
🔎 Algolia module for Nuxt

@nuxtjs/algolia Algolia module for Nuxt ✨ Release Notes ?? Read the documentation Features Nuxt 3 ready Easy integration with Algolia Handy composable

Nuxt Community 91 Jul 28, 2022
A Nuxt.js module that injects a server route to serve the GraphQL Playground

@pin-pon/nuxt-graphql-playground A Nuxt.js module that injects a server route to serve the GraphQL Playground Setup Add @pin-pon/nuxt-graphql-playgrou

Pin-Pon 3 Sep 22, 2022