The destructor of the SQL context deletes all files from the cache.
Would it make sense to have an option to keep the local cache alive?
The fetch_asset function would then have to check the local cache.
It could be a bit tricky to compare the date modified between local files and the database version though.
An alternative is to serialize the cache on teardown and attempt to load it on init.