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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache does not respect stalePeriod on web #393

Open
jimcullenaus opened this issue Nov 3, 2022 · 0 comments
Open

Cache does not respect stalePeriod on web #393

jimcullenaus opened this issue Nov 3, 2022 · 0 comments

Comments

@jimcullenaus
Copy link

馃悰 Bug Report

When setting a custom stalePeriod on web, the cache remains valid and the browser will access data via the cache rather than sending out a fresh network request, even when the Duration specified in stalePeriod has expired.

Expected behaviour

On all platforms, after a custom stalePeriod is set, items should be removed from the cache after the specified Duration has expired.

Reproduction steps

  1. Extend CacheManager with a Config(...stalePeriod: Duration(minutes: 1)
  2. Make a request that uses the CacheManager
  3. Wait over one minute
  4. Make the same request again

Observe that the second request hits the cache, not the web.

Configuration

Version: 3.3.0

Platform:

  • [鉁揮 馃審 Web

Cause

By default, the config for web uses the NonStoringObjectProvider. Old cache objects are removed using their provider's getOldObjects method. The implementation of this in the NonStoringObjectProvider never does anything.

Ideally, the web config should be update to use a repo that has a working implementation of getOldObjects.

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

No branches or pull requests

1 participant