Closed kiriDevs closed 2 years ago
As long as u do cache and don't rerequest this any time u reload the page, I don't see a problem.
Not that many people use it anyway
As long as u do cache and don't rerequest this any time u reload the page
These requests will probably be cached at some point, but probably not in the first version.
However, for this type of data a "cache-then-network" approach would likely make the most sense. On load, display cached data (if available) and make a request to the network. When the network request completes, update caches and display the new data.
I guess I could see if I could find a way to implement a sort of cooldown, so it doesn't try to load new data from the network automatically if the cached data is less than X minutes old (probably with 5 <= x <= 10
). This could slightly decrease performance for the time between cache response and network response, since the cached response has to arrive and be checked before the network request is even started, but that might be a reasonable trade-off.
Pre-requisites
This proposal depends on #39 being implemented.
The Proposal
When the app loads, it could pre-load the substitution plans for all date options offered to the user. This would significantly improve the user experience as time-to-content after a date switch would drop to 0.
Potentially, this behaviour could be only applied conditionally to not apply if the user has indicated that they prefer applications to use less data (
navigator.connection.saveData
istrue
).Considerations