From 7ad1420febc7f35b67f3b9a13f21a22c380d5026 Mon Sep 17 00:00:00 2001 From: Tony Air Date: Wed, 19 Jun 2024 19:48:33 +0200 Subject: [PATCH] IMPR: Cache control --- src/Ajax/AjaxFormRequestHandler.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Ajax/AjaxFormRequestHandler.php b/src/Ajax/AjaxFormRequestHandler.php index 2e850e8..bdf98f8 100644 --- a/src/Ajax/AjaxFormRequestHandler.php +++ b/src/Ajax/AjaxFormRequestHandler.php @@ -2,6 +2,7 @@ namespace A2nt\CMSNiceties\Ajax; +use SilverStripe\Control\Middleware\HTTPCacheControlMiddleware; use A2nt\CMSNiceties\Ajax\Ex\AjaxControllerEx; use SilverStripe\Forms\FormRequestHandler; use SilverStripe\ORM\ValidationResult; @@ -26,6 +27,9 @@ class AjaxFormRequestHandler extends FormRequestHandler { $resp = parent::httpSubmission($request); + HTTPCacheControlMiddleware::singleton() + ->disableCache(); + if (!AjaxControllerEx::isFormRequest()) { return $resp; }