DEV Community

Cover image for Caching & Revalidate: ServerSide vs ClientSide

Caching & Revalidate: ServerSide vs ClientSide

Rakshit Raj on November 29, 2023

A major feature which is often missed out by many web application especially dealing with data sharing and database like ecommerce websites, is dat...
Collapse
 
danko56666 profile image
Daniel Ko

This post is about caching but you are opting out of caching in your server fetch request and then you call a revalidate too? Why?

Collapse
 
rakshit47 profile image
Rakshit Raj • Edited

Thanks for noticing @danko56666, actually during the development period it took time to revalidate, and for getting the changes I did so, I made a mistake

instead of cache: "no-cache" it can be

 const res = await fetch(process.env.MOCKAPI!, {
    next: {
      tags: ["place"],
      revalidate: 60 * 60,
    },
  });
Enter fullscreen mode Exit fullscreen mode