#How to handle ISR cache when self hosting?

2 messages · Page 1 of 1 (latest)

chilly galleon
#

Hi, I host a next.js (Pages) site that has a lot of user generated pages on AWS. I have a couple of issues around my ISR pages I'm not sure how to deal with.

Note, I don't build all the pages at build time because there are too many, it's too slow and it takes up about 30gb.

  1. If I erase the existing .next/server/pages contents on the server before deploying, all pages need to be recalculated (even if no change) so navigating is slower for each page on the first attempt
  2. If I don't erase the .next/server/pages contents and there is a change to the html design, the old page will be served with potentially broken html/navigation.

I'm considering only deleting the .html files but potentially changes to json content could also be an issue. Maybe I need a way to specific when and what to delete based at deployment time based on the changelist.

I'm also considering the approach of switching to SSR and using cloudfront to cache but this feels like it might be susceptible to the same issue of serving broken content.

What approach is recommended for large numbers of quite big pages.

Thanks!

modern cloakBOT
#

🔎 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)