fluxy-bot 0.5.5 → 0.5.6
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/supervisor/index.ts +4 -1
package/package.json
CHANGED
package/supervisor/index.ts
CHANGED
|
@@ -259,7 +259,10 @@ export async function startSupervisor() {
|
|
|
259
259
|
if (stat.isFile()) {
|
|
260
260
|
const ext = path.extname(fullPath);
|
|
261
261
|
const mime = MIME_TYPES[ext] || 'application/octet-stream';
|
|
262
|
-
|
|
262
|
+
// HTML files: no-cache so rebuilds are picked up immediately
|
|
263
|
+
// Hashed assets (.js, .css): immutable caching
|
|
264
|
+
const cacheControl = ext === '.html' ? 'no-cache' : 'public, max-age=31536000, immutable';
|
|
265
|
+
res.writeHead(200, { 'Content-Type': mime, 'Cache-Control': cacheControl });
|
|
263
266
|
fs.createReadStream(fullPath).pipe(res);
|
|
264
267
|
} else {
|
|
265
268
|
res.writeHead(404);
|