nuxt-multi-cache
Advanced tools
Comparing version 1.0.5 to 1.1.0
@@ -31,3 +31,3 @@ "use strict"; | ||
const nuxt = this.nuxt; | ||
const provided = this.options.routeCache || {}; | ||
const provided = this.options.multiCache || {}; | ||
const enabled = !!provided.enabled; | ||
@@ -75,4 +75,6 @@ const enabledForRequest = provided.enabledForRequest || defaultEnabledForRequest; | ||
} | ||
if (!provided.server || typeof provided.server.auth !== 'object' && typeof provided.server.auth !== 'function') { | ||
logger('No serverAuth function or basic auth config provided, caching is disabled.', 'warn'); | ||
if (!provided.server || | ||
(typeof provided.server.auth !== 'object' && | ||
typeof provided.server.auth !== 'function')) { | ||
logger('No server.auth function or basic auth config provided, caching is disabled.', 'warn'); | ||
return; | ||
@@ -84,3 +86,5 @@ } | ||
let groupsCache = null; | ||
if (configComponentCache && configComponentCache.enabled && this.options.render.bundleRenderer) { | ||
if (configComponentCache && | ||
configComponentCache.enabled && | ||
this.options.render.bundleRenderer) { | ||
componentCache = new Component_1.default(configComponentCache); | ||
@@ -136,3 +140,5 @@ this.options.render.bundleRenderer.cache = componentCache; | ||
return renderRoute(route, context).then((result) => { | ||
if (pageCache && context.$cacheHelper && context.$cacheHelper.cacheable) { | ||
if (pageCache && | ||
context.$cacheHelper && | ||
context.$cacheHelper.cacheable) { | ||
const tags = context.$cacheHelper.tags || []; | ||
@@ -139,0 +145,0 @@ pageCache |
@@ -26,3 +26,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
const nuxt = this.nuxt; | ||
const provided = this.options.routeCache || {}; | ||
const provided = this.options.multiCache || {}; | ||
const enabled = !!provided.enabled; | ||
@@ -70,4 +70,6 @@ const enabledForRequest = provided.enabledForRequest || defaultEnabledForRequest; | ||
} | ||
if (!provided.server || typeof provided.server.auth !== 'object' && typeof provided.server.auth !== 'function') { | ||
logger('No serverAuth function or basic auth config provided, caching is disabled.', 'warn'); | ||
if (!provided.server || | ||
(typeof provided.server.auth !== 'object' && | ||
typeof provided.server.auth !== 'function')) { | ||
logger('No server.auth function or basic auth config provided, caching is disabled.', 'warn'); | ||
return; | ||
@@ -79,3 +81,5 @@ } | ||
let groupsCache = null; | ||
if (configComponentCache && configComponentCache.enabled && this.options.render.bundleRenderer) { | ||
if (configComponentCache && | ||
configComponentCache.enabled && | ||
this.options.render.bundleRenderer) { | ||
componentCache = new ComponentCache(configComponentCache); | ||
@@ -131,3 +135,5 @@ this.options.render.bundleRenderer.cache = componentCache; | ||
return renderRoute(route, context).then((result) => { | ||
if (pageCache && context.$cacheHelper && context.$cacheHelper.cacheable) { | ||
if (pageCache && | ||
context.$cacheHelper && | ||
context.$cacheHelper.cacheable) { | ||
const tags = context.$cacheHelper.tags || []; | ||
@@ -134,0 +140,0 @@ pageCache |
{ | ||
"name": "nuxt-multi-cache", | ||
"version": "1.0.5", | ||
"version": "1.1.0", | ||
"description": "SSR route, component and data cache for Nuxt.js", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
98253
2288