Make clients able to cache resources

At present time, if a Mopidy client wants to cache albums, tracks, or playlists, it’s impossible to implement without a knowledge of the Mopidy extension providing the resource to cache: One doesn’t want to cache albums created by Mopidy-Podcast (since tracks can be added at any time), but albums created by Mopidy-Local are rarely subject to change…

Could models for albums, tracks and playlists be extended with an optional expiry property?

That property would be filled by extensions supporting it. A recommendation could be to disable cache when that property is None. It’d be interpreted as the common header Expires - HTTP | MDN.

And it could be user configurable at the extension level: Eg if a user updates file tags at most once a year, he may expect that the resources managed by Mopidy-Local can be cached for a year…

I came across that need while implementing in Argos a library browser agnostic of Mopidy’s extensions.

Thoughts?