线上实测 /assets/index-u1PUen4p.js 返回的是 express.static 的默认 Cache-Control: public, max-age=0 —— 每开一次页面就要为每个 JS/CSS 跑一趟 回源校验。而这些文件名里本来就带内容 hash,内容一变文件名就变。 分两档: assets/* max-age=31536000, immutable(连 304 都不用问) index.html no-cache index.html 必须不缓存:它文件名固定、里面引用的才是带 hash 的资源名。 缓存住的话发了新版用户还拿着旧 index.html、指向旧资源,等于白更新。 SPA fallback 那条单独加了一遍 no-cache —— 它走 sendFile,不经过 express.static 的 setHeaders,/orders 这类深链拿到的同样是 index.html。 Co-Authored-By: Claude Opus 5 <[email protected]>
16 lines
458 B
JSON
16 lines
458 B
JSON
{
|
|
"name": "happy-export",
|
|
"version": "1.1.1",
|
|
"private": true,
|
|
"description": "happy 出口通 —— 一体化外贸出口工具系统(SKU 管理 / 知识库 / 客户 CRM / 邮件开发 / AI 回复 / AI 生成)",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git+https://github.com/Drsakura/happy-export.git"
|
|
},
|
|
"scripts": {
|
|
"dev": "cd frontend && npm run dev",
|
|
"start": "cd backend && npm start"
|
|
},
|
|
"license": "UNLICENSED"
|
|
}
|