wildpig 1.5.6 → 1.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/scripts/prodServer.ts +5 -1
package/package.json
CHANGED
package/scripts/prodServer.ts
CHANGED
|
@@ -51,7 +51,11 @@ export const startServer = async () => {
|
|
|
51
51
|
const filepath = "./client" + url.pathname;
|
|
52
52
|
// 检查文件是否存在
|
|
53
53
|
if(fs.existsSync(filepath) && fs.statSync(filepath).isFile()){
|
|
54
|
-
return new Response(Bun.file(filepath)
|
|
54
|
+
return new Response(Bun.file(filepath), {
|
|
55
|
+
headers: {
|
|
56
|
+
"Cache-Control": "public, max-age=864000" // 10 天缓存
|
|
57
|
+
}
|
|
58
|
+
});
|
|
55
59
|
}
|
|
56
60
|
// 文件不存在
|
|
57
61
|
return new Response("Not Found", {status: 404});
|