BJS-kr / nestjs-omacache

flexible, powerful and simple caching strategy using decorators for NestJS
72 stars 4 forks source link

persistent kind Internal Server Error #29

Open Mohamed-Emara77 opened 3 months ago

Mohamed-Emara77 commented 3 months ago

Issue persistent kind Internal Server Error when applied to an API with params

Docs persistent cache must used on method without parameters, otherwise, it will throw error that presents persistent cache cannot applied to method that have parameters.

expected behaviour

it should act like temporal kind with ttl = 0 which means infinity time to live cache each request should be treated as a separate key

for example : @Get('/uploads/:filename') async getFile(@Param('filename') filename: string){ return await this.service.getFile(fileName); } in the above example each request scoped under uploads API with a specific file name should have a cache key

if file name is test.png then key should look like this key:uploads/test.png if file name is guest.png then key should look like this key:uploads/guest.png

make sure to include query params as well

actual behaviour Internal server error

Great package by the way many thanks

BJS-kr commented 3 months ago

It was intentional. but if you want persistent cache with parameters, I'll add that feature