revalidatePath() not working when it is deployed on Vercel

182 Views Asked by At

When I'm Running my code in localhost the revalidation is working fine. But when I hosted my project on Vercel the page is revalidating for a certain time but when I reload or refresh the previously cached data is being displayed again and the network record is also again generating a Status code of 304. Been searching for answers but I couldn't find any.

My repo Link: https://github.com/nikhilbolla/vgse-admin-dashboard

Here's my Network record

The Post request is working fine, the data being Added into Database and Displaying for certain amount of time and when I reload the previous cached data is appearing again

I tried updating my vercel config file but unfortunately it couldn't fix any error


{
    "headers": [
      {
        "source": "/(.*)",
        "headers": [
          {
            "key": "Cache-Control",
            "value": "no-store"
          }
        ]
      }
    ]
  }

I'm Expecting to fetch the fresh data, on Demand revalidation when I update, Add or Deleting something.

0

There are 0 best solutions below