@@ -24,7 +24,7 @@ export default function createRecv(options, { strapi }) {
2424 ) ;
2525 }
2626 const store = strapi . plugin ( 'rest-cache' ) . service ( 'cacheStore' ) ;
27- const { strategy } = strapi . config . get ( " plugin::rest-cache" ) ;
27+ const { strategy } = strapi . config . get ( ' plugin::rest-cache' ) ;
2828 const { cacheRouteConfig } = options ;
2929 const { hitpass, maxAge, keys } = cacheRouteConfig ;
3030 const { enableEtag = false , enableXCacheHeaders = false } = strategy ;
@@ -34,7 +34,7 @@ export default function createRecv(options, { strapi }) {
3434 const cacheKey = generateCacheKey ( ctx , keys ) ;
3535
3636 // hitpass check
37- const lookup = shouldLookup ( ctx , hitpass ) ;
37+ const lookup = await shouldLookup ( ctx , hitpass ) ;
3838
3939 // keep track of the etag
4040 let etagCached = null ;
@@ -112,19 +112,15 @@ export default function createRecv(options, { strapi }) {
112112 // persist etag asynchronously
113113 store . set ( `${ cacheKey } _etag` , etag , maxAge ) . catch ( ( ) => {
114114 debug ( 'strapi:plugin-rest-cache' ) (
115- `[RECV] GET ${ cacheKey } ${ chalk . yellow (
116- 'Unable to store ETag in cache'
117- ) } `
115+ `[RECV] GET ${ cacheKey } ${ chalk . yellow ( 'Unable to store ETag in cache' ) } `
118116 ) ;
119117 } ) ;
120118 }
121119
122120 // persist cache asynchronously
123121 store . set ( cacheKey , ctx . body , maxAge ) . catch ( ( ) => {
124122 debug ( 'strapi:plugin-rest-cache' ) (
125- `[RECV] GET ${ cacheKey } ${ chalk . yellow (
126- 'Unable to store Content in cache'
127- ) } `
123+ `[RECV] GET ${ cacheKey } ${ chalk . yellow ( 'Unable to store Content in cache' ) } `
128124 ) ;
129125 } ) ;
130126 }
0 commit comments