gmpassos / mercury_client

A Simple Dart HTTP client (Web and Native support)
https://pub.dev/packages/mercury_client
BSD 3-Clause "New" or "Revised" License
5 stars 0 forks source link

stale-while-revalidate #2

Closed rogueturnip closed 3 years ago

rogueturnip commented 3 years ago

Does the in memory cache work like a stale-while-revalidate cache? RFC 5861 https://tools.ietf.org/html/rfc5861

I just am curious if I can use the cached data to show the UI and it will update once the new data comes in.

gmpassos commented 3 years ago

Good idea. I'm implementing something similar, where it notifies if you can use a temporary version of what is cached.

gmpassos commented 3 years ago

I have released mercury_client v.2.1.0, with stale response notification: https://pub.dev/packages/mercury_client