feat: v2 内容更新——assets 换 v2 构建+缓存策略改 no-cache+行程数据扩充+图片调整
- assets: index js/css 升级 v2(修复手改资源文件名哈希不变导致长缓存不生效) - server.js: assets 缓存 immutable→no-cache - admin.js: 后台功能更新(上传/占位图相关) - data.json/data.seed.json: 行程与酒店内容扩充(4041→4274 行) - hotels: 删 _placeholder.png, 增 序成品稿-封面.jpg 来源: hulai-travel-site(1).zip (2026-08-18)
这个提交包含在:
@@ -147,7 +147,8 @@ function serveStatic(req, res, urlPath) {
|
||||
const headers = { 'Content-Type': MIME[ext] || 'application/octet-stream' };
|
||||
const abs = p.startsWith('/assets/');
|
||||
const isHotels = p.startsWith('/hotels/');
|
||||
if (abs) headers['Cache-Control'] = 'public, max-age=31536000, immutable';
|
||||
// 无构建步骤、资源为手改(文件名哈希不随内容变),不用 immutable 长缓存,避免改动不生效
|
||||
if (abs) headers['Cache-Control'] = 'no-cache';
|
||||
else if (isHotels || ext === '.json') headers['Cache-Control'] = 'no-cache';
|
||||
else headers['Cache-Control'] = 'no-cache';
|
||||
res.writeHead(200, headers);
|
||||
|
||||
在新工单中引用
屏蔽一个用户