As a general concept, caching does not imply an implementation strategy. A common idea is that you store information somewhere, which provides more efficient access than when you received the data initially.
So, in this case, it is more efficient to receive data from the disk than to request Twitter (usually, latency is greater than the latency of the IO disk).
In addition, retrieving data from memory is more efficient than retrieving information from a disk (since memory latency is less than the IO disk latency).
At the same time, you can save the values ββfrom Twitter in memory, if you want, or to a file on disk, if you need values ββthat you need to save, not to mention shutdown. How you do this is up to you (disk or memory, extensions, format, etc. Etc.). This is your cache.
The thing you should be careful about is cache growing sluggishly. This is when the information that you have in your cache is not synchronized with the original data source. You must make a determination for your application how outdated data is acceptable, and require you to replace your cache values ββas necessary.
casperOne
source share