patch: fixed sticky sidebar on mobile

This commit is contained in:
venus
2026-09-15 09:18:27 -05:00
parent 835ac40cd2
commit f77b43c766
3 changed files with 25 additions and 6 deletions
+2 -2
View File
@@ -347,8 +347,8 @@ export function createServer(customSiteDir, customPostsDir, customAssetsDir) {
const ext = path.extname(targetFile).toLowerCase();
const contentType = MIME_TYPES[ext] || "application/octet-stream";
// Cache control: assets get long-term caching, html gets short
if (decodedPath.startsWith("/assets/")) {
// Cache control: static media and webfonts get long-term caching; CSS, JS, and HTML get short revalidation
if (decodedPath.startsWith("/assets/") && !decodedPath.endsWith(".css") && !decodedPath.endsWith(".js")) {
res.setHeader("Cache-Control", "public, max-age=2592000, immutable");
} else {
res.setHeader("Cache-Control", "public, max-age=0, must-revalidate");