fuse-open / fuselibs

Fuselibs is the Uno-libraries that provide the UI framework used in Fuse apps
https://npmjs.com/package/@fuse-open/fuselibs
MIT License
176 stars 72 forks source link

Introduce DiskCachePolicy in HttpImageSource #1356

Closed ichan-mb closed 4 years ago

ichan-mb commented 4 years ago

HttpImageSource since version 1.12 has support for disk caching to store downloaded images on the local disk using DiskCache property, so next time when we loaded image again with the same URL it will pick up from local disk instead of making request to the network.

But the current implementation of disk caching does not obey Http cache-control header sent by the server. So it always uses a local version even if the server mark image as stale and has to load again from the network.

We introduce DiskCachePolicy to give options on how DiskCache should behavior. There are two options:

Note: This PR requires Uno PR: https://github.com/fuse-open/uno/pull/321

This PR contains: