Closed muratcorlu closed 5 years ago
Is it possible to keep caches for old function parameters too?
@Cacheable() getArticle(id: string): Observable<Article> { .... }
I call this method several times with different articleIds in a view, then none of my requests are being cached actually. My expected behaviour was to cached every article request separately.
articleId
You can provide a maxCacheCount parameter to the Cacheable like:
maxCacheCount
Cacheable
@Cacheable({ maxCacheCount: 100 })
This will make the decorator cache the last 100 calls.
OK, I think this'll fulfil my needs. Thanks.
Is it possible to keep caches for old function parameters too?
I call this method several times with different
articleId
s in a view, then none of my requests are being cached actually. My expected behaviour was to cached every article request separately.