Progress route: opt out of LiteSpeed cache via its hook
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0185ukXhhC8xipsBR7e3o76i
This commit is contained in:
1 parent
c6520b761a
commit
0180aacd72
1 file changed
+3
-1
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user