From 0180aacd72e8445f48602121340a011a45458a2c Mon Sep 17 00:00:00 2001 From: Josh Knapp Date: Mon, 16 Nov 2026 08:37:10 -0800 Subject: [PATCH] Progress route: opt out of LiteSpeed cache via its hook Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_0185ukXhhC8xipsBR7e3o76i --- includes/Rest/DonateController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/Rest/DonateController.php b/includes/Rest/DonateController.php index e8da5e7..13df41d 100644 --- a/includes/Rest/DonateController.php +++ b/includes/Rest/DonateController.php @@ -85,7 +85,9 @@ final class DonateController { $res = rest_ensure_response( self::progress_for( $goal ) ); // Short shared cache lets a CDN collapse bursts; the page JS adds a cache-busting parameter after a donation. $res->header( 'Cache-Control', 'public, max-age=10, s-maxage=10' ); - $res->header( 'X-LiteSpeed-Cache-Control', 'no-cache' ); // LiteSpeed would otherwise hold REST responses for days + // LiteSpeed Cache would otherwise hold REST responses for days; it has its own opt-out hook. + do_action( 'litespeed_control_set_nocache', 'streamgoals progress' ); + $res->header( 'X-LiteSpeed-Cache-Control', 'no-cache' ); return $res; }