Closed macklinu closed 8 years ago
This looks like a potentially awesome way to take our newly AutoValue'd models and connect them to a database to pull from locally - might help see this issue through to fruition. :ok:
This basically happened with the DataSource
class, which stores the data + status (loading, loaded, error, etc) and emits updated Data
when it is received. The data is cached in memory in this class, and since the app only really fetches sessions and sponsors from the API, this was the simplest way to balance persisting data to prevent additional API requests.
There are 4 API requests in the app:
Moving forward, it would be nice to batch the 3 GET requests and store the data locally in a database. The app would only load from the database. I envision this being useful at the conference, since the app would work much better offline this way.
Perhaps related, or maybe an optimization on top of this would be better caching. Communicating to the backend with the proper Modified-Since headers would prevent unnecessary fetching of data that is already stored locally on the device.