Update blog page asset and md loading
This commit is contained in:
+5
-1
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user