ishan0102 / engblogs

learn from your favorite tech companies
https://engblogs.dev
MIT License
162 stars 16 forks source link

Speculative: What if we preload the items on the next page #5

Closed yxzwucsd closed 1 year ago

yxzwucsd commented 1 year ago

Just a thought, been thinking about similar stuff in prior work, might actually get my hand on this one

ishan0102 commented 1 year ago

I wrote a simple prefetching implementation but it wasn't working, didn't get a chance to debug. Feel free to try your hand on this if you have some time! Currently I use sessionStorage on all pages viewed by a user, so if you're reading the tab and bouncing back and forth between pages you'll only see latency the first time you view any given page. Thought about using localStorage, but the issue with that is it'll retain posts even after they're updated by my cronjob, which is bad.