nuxt-cache-ssr
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -7,3 +7,3 @@ { | ||
}, | ||
"version": "1.0.2" | ||
"version": "1.0.3" | ||
} |
{ | ||
"name": "nuxt-cache-ssr", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"license": "MIT", | ||
@@ -29,3 +29,4 @@ "type": "module", | ||
"dependencies": { | ||
"cache-manager": "^5.1.1" | ||
"cache-manager": "^5.1.1", | ||
"ohash": "^0.1.5" | ||
}, | ||
@@ -57,2 +58,2 @@ "devDependencies": { | ||
"homepage": "https://github.com/bhaskarGyan/nuxt-cache-ssr#readme" | ||
} | ||
} |
@@ -28,2 +28,17 @@ # nuxt-cache-ssr | ||
], | ||
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("-") | ||
} | ||
}, | ||
@@ -34,4 +49,25 @@ | ||
``` | ||
### Device Interface | ||
```javascript | ||
interface Device { | ||
userAgent: string | ||
isDesktop: boolean | ||
isIos: boolean | ||
isAndroid: boolean | ||
isMobile: boolean | ||
isMobileOrTablet: boolean | ||
isDesktopOrTablet: boolean | ||
isTablet: boolean | ||
isWindows: boolean | ||
isMacOS: boolean | ||
isApple: boolean | ||
isSafari: boolean | ||
isFirefox: boolean | ||
isEdge: boolean | ||
isChrome: boolean | ||
isSamsung: boolean | ||
isCrawler: boolean | ||
} | ||
``` | ||
### TODO | ||
@@ -41,3 +77,3 @@ | ||
- [ ] Regex for Pages | ||
- [ ] Custom Key for Page Cache | ||
- [x] Custom Key for Page Cache | ||
- [ ] Redis Cache |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
7687
141
76
2
1
2
+ Addedohash@^0.1.5
+ Addedohash@0.1.5(transitive)