IMPR: Cache control

This commit is contained in:
Tony Air 2024-06-19 19:48:33 +02:00
parent c74c1afad1
commit 7ad1420feb

View File

@ -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;
}