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

Set Cache expiration #196

Open
lane711 opened this issue Aug 14, 2023 · 0 comments
Open

Set Cache expiration #196

lane711 opened this issue Aug 14, 2023 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed in progress

Comments

@lane711
Copy link
Owner

lane711 commented Aug 14, 2023

The data tier automatically caches responses per here:
https://sonicjs.com/persistance#caching-in-memory-and-kv-cache

We need to establish methods to invalidate the cache so that it is re-retrieving from D1. Initially we can simply set a time bases cache time

The default will be 10 minutes, but can be overridden in the config(wrangler.toml)
Applicable code:
https://github.com/lane711/sonicjs/blob/main/src/cms/data/data.ts#L22

Applicable integration test to expand:
https://github.com/lane711/sonicjs/blob/main/src/cms/data/data.test.ts#L11

In future stories, this will be longer-living and based on data updates to maximize performance.

@lane711 lane711 added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed in progress
Projects
None yet
Development

No branches or pull requests

1 participant