I’m working with Next.js 14 and have a dynamic route with more than 10,000 products. The calls made when a product is clicked (found via a search bar) are slow. Unfortunately, I cannot optimize or speed up these calls. However, the data changes at most once a day after midnight.
I was wondering if there is a way to:
Pre-load all the information after midnight (even if it might be inefficient since only 10 products might be viewed throughout the day)
Pre-load all the information on the first user click and then cache it for the entire day
I have read the documentation on caching, revalidate, and revalidatePath, but I am not sure if these functionalities can help in my case.
Can someone provide guidance on how to implement a suitable solution?
Thanks in advance!