Assets cache invalidation



As you may know, GNOME Software uses its major.minor version as the name for its assets cache (~/cache/gnome-software/3.26).

The reason behind this seems to be like some kind of automatic invalidation of the cache.
The problem though, is that by doing this we are invalidating the cache when didn't have to, while also not deleting the old version's one, and this leaves us with several copies of the cache throughout the time. For example, in my Fedora machine that I have been using for a while, I have:

 ls ~/.cache/gnome-software/
 3.19/        3.20/        3.21/        3.22/        3.23/        3.24/        3.25/        firmware/    screenshots/

Even though the space occupied by this is not very much (roughly 50 MB), having to redownload every single screenshot (and in Endless' case, every single app tile image too) is negligible for most of us here, but for users with metered and/or very unreliable connections it's an unnecessary hassle that will surely hamper the UX.

Another thing to note is that the system cache is not tied to a version, and apparently it hasn't been a problem (or maybe only Endless is using it?).

I may not have the full picture about all the plugins that may need an invalidated cache on every new version, but I think that we could have a cache that's tied to an agreed incremental number instead... And to delete it altogether (or migrate it a bit more smartly) when it needs to be invalidated.
Perhaps it's also worth giving each plugin their own cache, for them to manage as they will. In that case we'd have a general cache (screenshots, etc.) and a different one for each plugin. The advantage is that we could invalidate the general cache without affecting the plugins'.


I am looking forward to getting your opinions about this.

Cheers,

Joaquim Rocha  |  Endless


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]