VuePress EcosystemVuePress Ecosystem
  • Theme Guidelines
  • theme-default
  • Hope Theme
  • Plume Theme
  • Reco Theme
  • Feature Plugins
  • Markdown Plugins
  • Search Plugins
  • Blog Plugins
  • PWA Plugins
  • Analytics Plugins
  • SEO Plugins
  • Development Plugins
  • Tool Plugins
  • @vuepress/helper
  • English
  • 简体中文
GitHub
  • Theme Guidelines
  • theme-default
  • Hope Theme
  • Plume Theme
  • Reco Theme
  • Feature Plugins
  • Markdown Plugins
  • Search Plugins
  • Blog Plugins
  • PWA Plugins
  • Analytics Plugins
  • SEO Plugins
  • Development Plugins
  • Tool Plugins
  • @vuepress/helper
  • English
  • 简体中文
GitHub
  • cache
  • google-tag-manager
  • redirect
  • register-components

cache

@vuepress/plugin-cache

This plugin is used to solve the issue of long startup times in VuePress.

By caching the markdown render during the initial startup of the VuePress development server, the plugin skips unnecessary markdown render on subsequent startups, thus speeding up the startup process.

Usage

npm i -D @vuepress/plugin-cache@next

Using it as last plugin

It is recommended to place cachePlugin as the last item in the plugins configuration, as this can ensure maximum utilization of caching.

.vuepress/config.ts
import { cachePlugin } from '@vuepress/plugin-cache'

export default {
  plugins: [
    // ... other plugins

    // using as the last plugin
    cachePlugin({
      // options
    }),
  ],
}

Options

type

  • Type: 'memory' | 'filesystem'

  • Default: 'memory'

  • Details:

    Cache Types

    • 'memory' is for memory cache, using memory cache can achieve optimal optimization effects, but as the project scales up, it occupies more memory, suitable for projects with fewer pages.
    • 'filesystem' is for file system cache, for complex projects with many pages, file cache is recommended.

enableInCi

  • Type: boolean

  • Default: false

  • Details:

    Whether to enable the cache in CI environment.

    In most cases, the cache plugin could slow down the speed in ci.

Edit this page on GitHub
Last Updated:: 4/12/25, 7:03 PM
Contributors: pengzhanbo, Mister-Hope
Next
google-tag-manager