Tighten YouTube RSS cache to 15 min (matches YouTube CDN max-age)
This commit is contained in:
parent
c6aabdcbce
commit
f67bf32643
2
src/routes/youtube.js
Normal file → Executable file
2
src/routes/youtube.js
Normal file → Executable file
@ -7,7 +7,7 @@ const router = express.Router();
|
||||
const CHANNEL_ID = 'UCG_ZDOP21i0Ah26FxiuZmkg';
|
||||
const RSS_URL = `https://www.youtube.com/feeds/videos.xml?channel_id=${CHANNEL_ID}`;
|
||||
const MAX_VIDEOS = 3;
|
||||
const CACHE_TTL_MS = 30 * 60 * 1000; // refresh from YouTube every 30 minutes
|
||||
const CACHE_TTL_MS = 15 * 60 * 1000; // refresh from YouTube every 15 min (matches YouTube RSS own max-age=900)
|
||||
|
||||
// In-memory cache (also serves stale data if YouTube is unreachable)
|
||||
let cache = { videos: null, fetchedAt: 0 };
|
||||
|
||||
Loading…
Reference in New Issue
Block a user