← back to AsSeenInMovies
asim sitemap.xml + .txt Cache-Control 1h→6h + SWR 24h (catalog rarely changes that fast). 69/69.
c6662ec0b9b4caa59eb8e4429a6addd650e6bc5a · 2026-05-13 08:50:14 -0700 · SteveStudio2
Files touched
Diff
commit c6662ec0b9b4caa59eb8e4429a6addd650e6bc5a
Author: SteveStudio2 <stevestudio2@SteveStacStudio.lan>
Date: Wed May 13 08:50:14 2026 -0700
asim sitemap.xml + .txt Cache-Control 1h→6h + SWR 24h (catalog rarely changes that fast). 69/69.
---
server.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/server.js b/server.js
index 3a46932..4acd1ad 100644
--- a/server.js
+++ b/server.js
@@ -1902,7 +1902,7 @@ app.get('/sitemap.xml', async (_req, res) => {
}
const xml = `<?xml version="1.0" encoding="UTF-8"?>\n<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">\n ${urls.join('\n ')}\n</urlset>`;
_sitemapCache = { at: now, xml };
- res.setHeader('Cache-Control', 'public, max-age=3600');
+ res.setHeader('Cache-Control', 'public, max-age=21600, stale-while-revalidate=86400');
res.type('application/xml').send(xml);
} catch (e) {
res.status(500).type('text/plain').send(`error: ${e.message}`);
@@ -2044,7 +2044,7 @@ app.get('/sitemap.txt', async (_req, res) => {
return res.type('text/plain').send('# sitemap warming\n');
}
const urls = (xml.match(/<loc>([^<]+)<\/loc>/g) || []).map(m => m.slice(5, -6));
- res.setHeader('Cache-Control', 'public, max-age=3600');
+ res.setHeader('Cache-Control', 'public, max-age=21600, stale-while-revalidate=86400');
res.type('text/plain').send(urls.join('\n') + '\n');
} catch (e) {
res.status(500).type('text/plain').send(`error: ${e.message}`);
← 1df1a75 asim smoke --json suppresses header so output is parseable.
·
back to AsSeenInMovies
·
snapshot: 1 file(s) changed, ~1 modified 0d70bcf →