Fix comments not loading: disable 24hr Cloudflare cache on comments endpoint

getComments was using createResponse default cacheDuration=86400 (24 hours).
Cloudflare was serving a stale cached response, so comments appeared empty
or outdated on every load. Set cacheDuration=0 (no-store) so each request
hits the DB fresh.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
King Omar 2026-06-27 03:38:12 +10:00
parent fe1245faf9
commit e1b3c7600e

View file

@ -1718,7 +1718,7 @@ async function getComments(request, env) {
});
}
return createResponse(comments.results);
return createResponse(comments.results, 200, 0);
} catch (dbError) {
return createResponse({
error: 'Failed to retrieve comments',