vedartm / paginate_firestore

A flutter package to simplify pagination with firestore data 🗃
https://pub.dev/packages/paginate_firestore
MIT License
113 stars 138 forks source link

cache query #56

Closed azazadev closed 3 years ago

azazadev commented 3 years ago

Hi, any plan to support cache query ? as you know we cannot imagine usage of firestore without caching for most of use case, just close and open the app will trigger new docs read if no local cache configured

m-j-g commented 3 years ago

If you set the "isLive" parameter to true it uses snapshots() instead of get(). snapshots() loads from cache by default correct? Only triggers reads if there has been an update?

vedartm commented 3 years ago

As @m-j-g mentioned, you can set isLive to true which will use snapshots which in turn helps with caching.

vedartm commented 3 years ago

Thanks for using the package. Feel free to reopen if you face any similar issues.

fazaza commented 3 years ago

Thanks @excogitatr @m-j-g for the answer, I know that snapshots loads from cache by default, but when offline more than 30 minutes the snapshots will read data again from server, I'm fine to close issue for now

p4-k4 commented 2 years ago

Firstly, thanks for putting this package together, literally saved me!

Regarding this issue, how feasible is it to allow users to set a timeout on whether or not we're fetching from the cache or server?

In the case of data that won't be stale for a few days, we could drastically reduce document reads but this would obviously be quite project specific.

Thanks