concept memory in category design

This is an excerpt from Manning's book Usability Matters: Mobile-first UX for developers and other accidental designers.
Mail clients are generally good at managing resources related to data network connections, but there isn’t always the same consideration paid to local resources on the device. When attaching a large file to an email, some clients create additional copies of the file, which can impact disk space and I/O. This should be avoided. Also, loading the contents of any attached file into memory before sending is an extravagant action that can slow the performance of the app and unnecessarily consume resources.
Because Melissa’s app is so large, the OS takes a lot of time to load it into memory before it starts. This is an issue she wants to improve. For Melissa, removing functionality to reduce the size isn’t an option, nor is splitting areas of functionality into separate apps (as Facebook did with Messenger). Rather than remove items from the app entirely, she chose to rearchitect the app to limit what needed to be loaded into memory when starting. Instead of a single package containing all the functionality of the app, she broke it into multiple smaller modules.
As in figure 11.1, starting the app only needs to load the app boot loader part of the code. This holds only the core parts of the app needed for communication with the server and a placeholder UI. When the server responds, the app loads modules based on the person’s account status and how they launched the app. The parts of the app that aren’t needed never get loaded into memory. Any that are needed are small and load quickly.
If you only retrieve something once, you don’t need to consider caching it. Nor should you cache something guaranteed to be different when you want it again; you don’t want to show old data even if clearly indicating it as old. For everything else, it’s worth considering caching. You can store cached items in memory or on disk, and each approach has its pros and cons, as shown in table 11.2.
Table 11.2. Pros and cons of keeping cached data in different locations
Location
Pros
Cons
In memory
- Fast to access and update
- Available when using the app offline
- Limited by how much can be stored
- Not preserved between app restarts
On disk
- Available even if you start the app offline
- Preserved between app restarts
- Size is only limited by available disk space
- Slower to access than memory
- Can result in lots of disk I/O
- Need to manage amount of disk usage
Whether you store cached data in memory or on disk isn’t an exclusive decision. It’s possible to use both, but this makes the logic around retrieving data and keeping caches up to date more sophisticated.