#Agressively cache a large ecommerce page with external database (e.g. redis)

1 messages · Page 1 of 1 (latest)

fleet sun
#
  • We have more than 1M pages
  • We tried using ISR but it doesnt persist over builds (we build multiple times daily) and the first request is still too slow. We barely change our product data so the cache could really have a long ttl.
  • The Product pages are simply a bit too slow, many API requests etc.. But the data barely changes.

=> we want to fully cache these pages in a different database, ideally some key value lookup like redis or something.

Has anyone done this before?

In my perfect world we would do this:

  1. Request hits product/[handle]
  2. Check if key[handle] has a the cached page in remote redis. If yes return.
  3. Else, make fetches, return page and safe to cache

Doesnt sound super complicated but before we implement this I was wondering if this is the best approach? Thanks for any pointers! ✌️

foggy owlBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

outer badge
fleet sun
#

Thanks that looks fantastic! We host on Vercel though and this package seems to be recommended for self-hosting. Does it make sense to use this when hosting on vercel?

somber hinge
#

I think vercel KV is discontinued or something.
You can use Upstash only

#

I'm not sure, but you can see if you can use Vercel Edge config