1

I have a project using next.js and databse, I'm trying to make it on vercel hosting provider, I can send the data to databse from my app but it doesn't update until I go to the sitting and purge the cache, how can I set my project to no cache automatically.

i tried to change to project next.config itself but it is not working

/** @type {import('next').NextConfig} */
const nextConfig = {
  experimental: {
    appDir: true,
  },
  async headers() {
    return [
      {
        source: '/(.*)',
        headers: [
          {
            key: 'Cache-Control',
            value: 'no-store',
          },
        ],
      },
    ];
  },
};

module.exports = nextConfig;


shadab
  • 11
  • 1
  • Did you have a chance to read the docs? https://nextjs.org/docs/app/building-your-application/data-fetching/caching | https://nextjs.org/docs/app/building-your-application/data-fetching/revalidating – Igor Danchenko Jul 05 '23 at 19:10

0 Answers0