Update blog page asset and md loading

This commit is contained in:
adilallo
2025-09-05 09:46:48 -06:00
parent 5e83655f49
commit b85b4248c0
11 changed files with 126 additions and 170 deletions
+5 -1
View File
@@ -9,7 +9,9 @@ const tagCache = new Map();
const authorCache = new Map();
// Cache configuration
const CACHE_TTL = 5 * 60 * 1000; // 5 minutes in milliseconds
const isDevelopment =
process.env.NODE_ENV === "development" || !process.env.NODE_ENV;
const CACHE_TTL = isDevelopment ? 0 : 5 * 60 * 1000; // 0 in dev, 5 minutes in production
const MAX_CACHE_SIZE = 100; // Maximum number of cached items
/**
@@ -22,6 +24,8 @@ class CacheEntry {
}
isExpired() {
// In development, always consider cache expired (no caching)
if (isDevelopment) return true;
return Date.now() - this.timestamp > CACHE_TTL;
}
}