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

Cache main page database query #50

Merged
merged 13 commits into from
Apr 23, 2024
Merged

Cache main page database query #50

merged 13 commits into from
Apr 23, 2024

Conversation

yum25
Copy link
Member

@yum25 yum25 commented Apr 19, 2024

Continues from #49

yum25 added 10 commits April 19, 2024 18:05
return cache response json

return none, log output
log cache status

use standard js datetimeoptions type
remove trailing slash
use waitUntil on load and update

change error code

change production type to accurately reflect what it is

change PRODUCTION comparison to be more explicit

reverse conditional url order

revert change

log production variable

log url origin
remove url origin log
@yum25 yum25 changed the title (WIP) Fix worker invalidation (WIP) Cache main page database query Apr 19, 2024
Copy link

cloudflare-workers-and-pages bot commented Apr 21, 2024

Deploying michigan-daily-alt-text-tracker with  Cloudflare Pages  Cloudflare Pages

Latest commit: f34dfa5
Status: ✅  Deploy successful!
Preview URL: https://32d744c1.michigan-daily-alt-text-tracker.pages.dev
Branch Preview URL: https://cache-reads.michigan-daily-alt-text-tracker.pages.dev

View logs

@yum25 yum25 changed the title (WIP) Cache main page database query Cache main page database query Apr 21, 2024
@yum25
Copy link
Member Author

yum25 commented Apr 21, 2024

Current implementation calculates the amount of time until the next cron trigger, giving a spacing of 1 minute to account for the range of time the trigger could possibly fire in.

Haven't thoroughly tested this but logging results from the calculation do seem to line up. Might wait until another 12:01 PM to test this.

Consideration of an exposed cache invalidation endpoint at #51

@yum25 yum25 merged commit 508898a into main Apr 23, 2024
1 check passed
@yum25 yum25 deleted the cache-reads branch April 23, 2024 16:31
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