4
2
Fork 0

Caching #26

Closed
opened 2019-03-01 20:23:42 +08:00 by ambrose · 0 comments

There are two ways I think we can go about this.

  1. The first way is to write a wrapper around the http.dart library, call it something like cache_http and use it as a way to generically cache any requests made through the http library. This custom wrapper version of the http library can be used in the resource classes where caching is required (conversations, contacts etc.)

  2. The second way is to write a superclass, Cacheable and so resource classes like conversation_api_provider will be subclasses of the superclass. Then, the superclass can use attribute access intercepting to cache method calls of the subclasses.

I think the first way is easier to implement, but that's your call. Use any of these methods or anything else that you think works better.

There are two ways I think we can go about this. 1) The first way is to write a wrapper around the http.dart library, call it something like `cache_http` and use it as a way to generically cache any requests made through the http library. This custom wrapper version of the http library can be used in the resource classes where caching is required (conversations, contacts etc.) 2) The second way is to write a superclass, `Cacheable` and so resource classes like `conversation_api_provider` will be subclasses of the superclass. Then, the superclass can use attribute access intercepting to cache method calls of the subclasses. I think the first way is easier to implement, but that's your call. Use any of these methods or anything else that you think works better.
daniel was assigned by ambrose 2019-03-01 20:23:42 +08:00
ambrose added the
next-week
label 2019-03-01 20:23:42 +08:00
sudharshan added the
logic
label 2019-03-04 11:02:26 +08:00
Sign in to join this conversation.
There is no content yet.