28 lines
689 B
TypeScript
28 lines
689 B
TypeScript
import type { NextConfig } from "next";
|
|
|
|
const nextConfig: NextConfig = {
|
|
experimental: {
|
|
serverActions: { bodySizeLimit: "25mb" },
|
|
},
|
|
async headers() {
|
|
const noCacheHeaders = [
|
|
{
|
|
key: "Cache-Control",
|
|
value: "no-store, no-cache, must-revalidate, proxy-revalidate",
|
|
},
|
|
{ key: "Pragma", value: "no-cache" },
|
|
{ key: "Expires", value: "0" },
|
|
];
|
|
return [
|
|
{ source: "/", headers: noCacheHeaders },
|
|
{
|
|
// 排除 /_next/ 静态资源(含 hash 可长期缓存),其余页面禁用缓存
|
|
source: "/:path((?!_next).*)",
|
|
headers: noCacheHeaders,
|
|
},
|
|
];
|
|
},
|
|
};
|
|
|
|
export default nextConfig;
|