patch: fixed sticky sidebar on mobile
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user