-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Caching Mechanism #695
Comments
https://www.npmjs.com/package/node-cache would probably be an ideal package to support "under the hood" of the Nest provider. I'd be happy to write this provider if you think it's a good idea, @kamilmysliwiec. |
Yeah, go for it! Maybe, let's create an interceptor that we could even put in the |
Hi @KerryRitter, any updates here? 🔥 |
I haven't been able to do much lately but this is on my to-do! Anyone is free to take over, happy to help where I can |
+1 |
+1 |
|
it wold be nice to have Method level @Cache annotation as well for service methods @Injectable()
export class ProductService {
@Cache(myStore, { ttl: 60 })
public async getProducts(): Promise<string[]> {
// return seed data from database
return [...];
}
} |
Is there a way to expose some generic cache (CacheStore) to have get and set methods to cache any arbitrary data?! |
@danil-z I was able to do this by injecting the cache manager into my cache service, you can checkout an example at https://github.com/kyle-mccarthy/nest-next-starter/blob/master/src/cache/cache.service.ts |
@danil-z this issue has been closed, it would be great to make another issue for this request. |
@kamilmysliwiec how to invalidate cache ? common use case
only manually ? |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I'm submitting a...
What is the motivation / use case for changing the behavior?
Supporting a simple in-memory cache provider out of the box would be a great, useful feature. Probably as an external installable package, i.e. @nest/cache. See https://docs.microsoft.com/en-us/aspnet/core/performance/caching/memory?view=aspnetcore-2.0 for an example.
The text was updated successfully, but these errors were encountered: