Closed hekike closed 8 years ago
oops, I forgot the tests :) I'll fix. How do you like the concept?
@hekike I like it. I used to have a similar approach in the past and noticed the two following issues:
@wcandillon I think it's better if we invalidate it when we are sure that it's changed, instead of doing nothing. But yes, still should have expiration date for cache entries. Would you be open to use a 3rd party cache library for expiration? It's saddly not implemented in $cacheFactory.
I'm using your library for an admin and it's pretty strange when I save something and don't see the changes. But without caching it's too slow. Maybe should provide an option to controlling these kind of invalidations by method and expiration.
@hekike I used http://jmdobry.github.io/angular-cache/ but it still required a lot of manual work. Maybe http://angular-data.pseudobry.com/documentation/api/angular-cache/angular-cache is the solution but I haven't check it out.
@wcandillon thanks. I will investigate/implement it and update you here.
@hekike Feel free to reopen if necessary.
Changes:
Why return with additional response params? Headers may contains necessary data like
x-total-count
(needed for pagination for example)