How to avoid caching in the app directory of Next.js?

Yes, in the app folder, Next.js by default caches all fetched results. If you are using fetch(), you can change this behavior per query, with revalidate or cache option: fetch(‘https://…’, { next: { revalidate: 10 } }); fetch(‘https://…’, { cache: ‘no-store’ }); You can also control the behavior with Route Segment Config, again if you … Read more

Error: Image Optimization using Next.js default loader is not compatible with `next export`

use akamai setting images.loader to ‘imgix’ caused dev and build errors. i used this instead: // next.config.js module.exports = { images: { loader: ‘akamai’, path: ”, }, } it just works for all i care about. possible values for images.loader are: [ default, imgix, cloudinary, akamai, custom ] reference: https://nextjs.org/docs/api-reference/next/image#built-in-loaders

How to properly set environment variables in Next.js app deployed to Vercel?

Simply creating a .env.local (or .env) file with your environment variables should be enough to be picked by Next.js on the server. There’s no need to add anything to your next.config.js. # .env.local CLIENT_URL=vxcxsfddfdgd MAILING_SERVICE_CLIENT_ID=1245785165455ghdgfhasbddahhhhhhhhm MAILING_SERVICE_CLIENT_SECRET=Rdfvcnsf4263543624362536 MAILING_SERVICE_REFRESH_TOKEN=000000 [email protected] However, if you need to expose a variable to the browser you have to prefix the variable … Read more