nuxt-cache-ssr
Advanced tools
Comparing version 1.0.9 to 1.1.0
@@ -10,3 +10,3 @@ { | ||
}, | ||
"version": "1.0.9" | ||
"version": "1.1.0" | ||
} |
{ | ||
"name": "nuxt-cache-ssr", | ||
"version": "1.0.9", | ||
"version": "1.1.0", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "type": "module", |
# nuxt-cache-ssr | ||
[![NPM version](https://img.shields.io/npm/v/nuxt-cache-ssr.svg)](https://www.npmjs.com/package/nuxt-cache-ssr) | ||
[![npm downloads][npm-downloads-src]][npm-downloads-href] | ||
In Memory Cache middleware for Nuxt3 SSR rendering . | ||
@@ -30,8 +32,2 @@ | ||
['nuxt-cache-ssr', { | ||
// experimental : To enable brotli compression pass encoding option as br | ||
compressResponse: {encoding:'gzip'}, | ||
// experimental : Pass headerkey in page response to exclude the page froom cache | ||
disableCacheOnDemand:{ | ||
headerKey:"x-no-cache-ssr" | ||
}, | ||
// Can be disable per enviroment, like in dev | ||
@@ -56,15 +52,5 @@ enabled: true, | ||
key: (route: string, headers: any, device: Device) => { | ||
// Link to the function will be broken, so cannot use any imported modules or custom functions | ||
//sample of using device to generate key | ||
const { userAgent, ...deviceType } = device | ||
const key = [route]; | ||
Object.keys(deviceType).forEach(val => { | ||
if (deviceType[val]) { | ||
key.push(val) | ||
} | ||
}) | ||
// returned value will be hashed using ohash | ||
return key.join("-") | ||
// Custom function to return cache key | ||
// return false to bypass cache | ||
} | ||
@@ -86,4 +72,3 @@ } | ||
| pages | `Array` | Yes |Pages to cache | N/A | | ||
| key | `Function` | No | Use for generating custo key based on route,headers,and device type. Returned string will be hashed using `ohash` | `url` | | ||
| compressResponse | `object` | No | To compress cached response with gzip or brotli | `false` | | ||
| key | `Function` | No | Use for generating custo key based on route,headers,and device type. Returned string will be hashed using `ohash`. return false to bypass cache | `url` | | ||
|||||| | ||
@@ -118,6 +103,5 @@ | ||
<!-- Badges --> | ||
<p align="center"> | ||
Visitor count<br> | ||
<img src="https://profile-counter.glitch.me/bhaskarGyan/count.svg" /> | ||
</p> | ||
[npm-downloads-src]: https://img.shields.io/npm/dt/nuxt-cache-ssr | ||
[npm-downloads-href]: https://npmjs.com/package/nuxt-cache-ssr |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
25511
20
368
104