Keep overlays and live responses out of LiteSpeed Cache
Test and Release / test (push) Successful in 3m47s
Test and Release / release (push) Successful in 13s

LiteSpeed Cache held overlay poll responses for 7 days, so OBS kept getting
304s and neither the goal bar nor alerts updated after a donation. The overlay
data, overlay pages and fee preview now opt out, as the progress route did.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
shadowdaoandClaude Sonnet 5.5 committed 2026-11-27 21:07:57 -08:00
1 parent 0180aacd72
commit 96bae1cbf9
6 files changed
+61 -3

No files matched your search

+2
View File
@@ -3,6 +3,7 @@ declare( strict_types=1 );
namespace StreamGoals\Overlay;
use StreamGoals\Core\PageCache;
use StreamGoals\Rest\OverlayController;
/** Serves the transparent OBS browser-source page at /streamgoals-overlay/{token}/{widget}/. */
@@ -46,6 +47,7 @@ final class Router {
if ( '' === $token || '' === $widget ) {
return;
}
PageCache::skip( 'overlay page' ); // nocache_headers() alone does not stop LiteSpeed Cache
if ( ! is_string( $token ) || ! is_string( $widget ) || ! in_array( $widget, OverlayService::WIDGETS, true ) || ! OverlayController::verify_token( $token ) ) {
global $wp_query;
$wp_query->set_404();