Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce DiskCachePolicy in HttpImageSource #1356

Merged
merged 1 commit into from
May 16, 2020

Conversation

ichan-mb
Copy link
Member

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:

  • Default: Honor cache-control header from the server
  • AlwaysUseLocalCache: Always use local data if available and ignoring the cache-control header

Note:
This PR requires Uno PR: fuse-open/uno#321

This PR contains:

  • Changelog
  • Documentation
  • Tests

Copy link
Member

@mortend mortend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work.

@mortend mortend merged commit 370de6f into fuse-open:master May 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants