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@nextUsing 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.
import { cachePlugin } from '@vuepress/plugin-cache'
export default {
plugins: [
// ... other plugins
// using as the last plugin
cachePlugin({
// options
}),
],
}Options
type
'filesystem' | 'memory'Default
'memory'Cache type.
'memory': Use memory cache. It can achieve optimal optimization effects, but as the project scales up, it occupies more memory, suitable for projects with fewer pages.'filesystem': Use file system cache, for complex projects with many pages, it is recommended.
enableInCI
booleanWhether to enable the cache in CI environment.
In most cases, the cache plugin could slow down the speed in CI.
enableInCiDeprecated
booleanDeprecated, use enableInCI instead.
