-
Notifications
You must be signed in to change notification settings - Fork 3
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
Account activity loading enhancement #334
base: dev
Are you sure you want to change the base?
Conversation
Deploying 2nicove with
|
Latest commit: |
e64cca2
|
Status: | ✅ Deploy successful! |
Preview URL: | https://e5790cf7.unicove2.pages.dev |
Branch Preview URL: | https://account-activity-loading.unicove2.pages.dev |
stale while revalidate should be longer than max age otherwise it doesn't get triggered
const headers = getCacheHeaders(5); | ||
const start = params.start === '0' ? 1 : Number(params.start); | ||
|
||
// Aggressively cache older activity |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't do this, because older activity shifts in time and the results aren't in the same sequence because its in descending order.
If the initial page shows records 99 through 90 (walking back in time), and page 2 shows 89 to 80 - then if a new entry is added to the front, record 90 would end up on page 2. If page 2 is cached, that record won't show.
account/overview
page will prefetch the data for the initialaccount/activity
page loadaccount/activity
page will prefetch the data for the next pageaccount/activity
page (a.k.a. the most recent data) is cached for 5s while older activity beyond the first page is cached for 3600s (1 hour)