Caching - Group22-MobileApp/Grupo22-Moviles GitHub Wiki
Caching strategies
Our cache is temporal, this implies transient data that is periodically deleted by the user, the app, or the OS. Additionally, our app is Online first which means the content is queried first from the Internet and then from the local cache if connection is not available.
Due to the nature of our app being Online first, the caching strategies we implemented are the following:
1. Cached on network response
For the main content in our app, the data is retrieved from the network and duplicated locally on the cache/local storage.
2. Cache then network
from certain info like user images, profile info, and some content, the cached data is shown first, then the data is updated in both the cache and UI when the data from the network arrives.
Flutter:
On our first implementation of a cache strategy, we decided to cache images that are being displayed in the app. This is important because it allows the app to first fetch the images from the internet and then store them locally so that they can be displayed faster the next time the user opens the view where the images are being displayed. This is important because it allows the app to load faster and provide a better user experience. The implementation of this strategy is done using the cached network images which allows you to cache images that are being displayed in the app that were retrieved from the internet. Is a simple approach but is a good start for the implementation of a cache strategy in the app. We will continue to work on the implementation of a cache strategy for the app to improve the user experience and make the app faster and more efficient. Here is an example of how we used the cached network images package to cache images in the app: