[object Object]

← back to AsSeenInMovies

sitemap.txt: emit Last-Modified header for conditional GET (304)

0f94cb493b1ef1ce4e3f961824a47d69693b619a · 2026-05-13 09:43:16 -0700 · SteveStudio2

Files touched

Diff

commit 0f94cb493b1ef1ce4e3f961824a47d69693b619a
Author: SteveStudio2 <stevestudio2@SteveStacStudio.lan>
Date:   Wed May 13 09:43:16 2026 -0700

    sitemap.txt: emit Last-Modified header for conditional GET (304)
---
 server.js | 1 +
 1 file changed, 1 insertion(+)

diff --git a/server.js b/server.js
index 7da74f2..42f4449 100644
--- a/server.js
+++ b/server.js
@@ -2072,6 +2072,7 @@ app.get('/sitemap.txt', async (_req, res) => {
     }
     const urls = (xml.match(/<loc>([^<]+)<\/loc>/g) || []).map(m => m.slice(5, -6));
     res.setHeader('Cache-Control', 'public, max-age=21600, stale-while-revalidate=86400');
+    res.setHeader('Last-Modified', new Date(_sitemapCache.at || Date.now()).toUTCString());
     res.type('text/plain').send(urls.join('\n') + '\n');
   } catch (e) {
     res.status(500).type('text/plain').send(`error: ${e.message}`);

← 98f890a sitemap.xml: emit Last-Modified header for conditional GET (  ·  back to AsSeenInMovies  ·  api/health: include uptime_s for ops dashboards 9dd8cca →