Next.js Discord

Discord Forum

cache nextjs ? nginx ?cloudflare ?

Answered
tensefrogomar posted this in #help-forum
Open in Discord
Hello guys, ii hope you doing good.

I have a question please regarding caching in nextjs/nginx/cloudflare

In my website i want to cach some pages, like /products/myproduct
I though using the function export const revalidate in my pages nexjts
But i want also to cach in nextjs/cloudflare, to avoid request coming in my web app

i want to know if a lead tech (or any advanced dev) can tell me what is actually used nowadays and what solution is better ?
Is it a good idea to cach in nginx ? ...
Knowing that for my connected users i'll have to send a cookie to show different prices !

So let me know if u have any experience in that cause i'm little lost in my decisions

Thank you for reading & helping me
Answered by Patrick MacDonald
Next JS cache components have some pretty neat features and it depends where your hosting like if your using vercel proxying threw cf is not recommended
View full answer

4 Replies

Next JS cache components have some pretty neat features and it depends where your hosting like if your using vercel proxying threw cf is not recommended
Answer
Cache components allows you to with a variety of methods to meet different situations, it also allows for caching across deployments in certain situations and across different users
Thank you for your response Patrick , i'm going to deploy on a vps , thats why i'm wondering if i should use Ningx cach , also what is the config you recommend to use for a web app (cpu, ram ) , if u just have an idea iit would be great
Sorry I use vercel I let them deal with all the fine details when I host