Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Enable browser caching of mtc.js as described in https://github.com/mautic/mautic/issues/3656
diff --git a/app/bundles/CoreBundle/Controller/JsController.php b/app/bundles/CoreBundle/Controller/JsController.php
index 1bd7fda30..a108d9e85 100644
--- a/app/bundles/CoreBundle/Controller/JsController.php
+++ b/app/bundles/CoreBundle/Controller/JsController.php
@@ -33,7 +33,7 @@ class JsController extends CommonController
$dispatcher->dispatch(CoreEvents::BUILD_MAUTIC_JS, $event);
}
- return new Response($event->getJs(), 200, ['Content-Type' => 'application/javascript']);
+ return new Response($event->getJs(), 200, ['Content-Type' => 'application/javascript', 'Cache-Control' => 'public, max-age=7200']);
}
/**
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment