angelnikolov / ts-cacheable

Observable/Promise Cache Decorator
https://npmjs.com/package/ts-cacheable
ISC License
340 stars 42 forks source link

how to cache modified object returned by PUT #83

Closed MasterATM closed 4 years ago

MasterATM commented 4 years ago

Hello, I have 2 methods:

It works really well. Now, if we modify our PUT request in the backend so as it returns the new modified object in the response, can we exploit it to refresh the cached value of getObject?

Thanks.

angelnikolov commented 4 years ago

Right now, there isn't a way to manually do that. The only way is to implement your own IStorageStrategy and create a mechanism in it to touch the cache and update it from outside. Apart from that, I can't think of any other way. https://github.com/angelnikolov/ngx-cacheable#creating-your-own-strategy

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.