mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-04-08 17:15:08 +02:00
Merge pull request #4391 from Icinga/improve-cache-handling
Improve cache handling
This commit is contained in:
commit
35659c8d51
@ -176,11 +176,22 @@ class ConfigController extends Controller
|
||||
|
||||
$form = new ActionForm();
|
||||
$form->setOnSuccess(function (ActionForm $form) {
|
||||
$module = $form->getValue('identifier');
|
||||
Icinga::app()->getModuleManager()->enableModule($module);
|
||||
Notification::success(sprintf($this->translate('Module "%s" enabled'), $module));
|
||||
$moduleName = $form->getValue('identifier');
|
||||
$module = Icinga::app()->getModuleManager()
|
||||
->enableModule($moduleName)
|
||||
->getModule($moduleName);
|
||||
Notification::success(sprintf($this->translate('Module "%s" enabled'), $moduleName));
|
||||
$form->onSuccess();
|
||||
$this->redirectHttp('config/modules');
|
||||
|
||||
if ($module->hasJs()) {
|
||||
$this->redirectHttp('config/modules');
|
||||
} else {
|
||||
if ($module->hasCss()) {
|
||||
$this->reloadCss();
|
||||
}
|
||||
|
||||
$this->rerenderLayout()->redirectNow('config/modules');
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
@ -202,11 +213,22 @@ class ConfigController extends Controller
|
||||
|
||||
$form = new ActionForm();
|
||||
$form->setOnSuccess(function (ActionForm $form) {
|
||||
$module = $form->getValue('identifier');
|
||||
Icinga::app()->getModuleManager()->disableModule($module);
|
||||
Notification::success(sprintf($this->translate('Module "%s" disabled'), $module));
|
||||
$mm = Icinga::app()->getModuleManager();
|
||||
$moduleName = $form->getValue('identifier');
|
||||
$module = $mm->getModule($moduleName);
|
||||
$mm->disableModule($moduleName);
|
||||
Notification::success(sprintf($this->translate('Module "%s" disabled'), $moduleName));
|
||||
$form->onSuccess();
|
||||
$this->redirectHttp('config/modules');
|
||||
|
||||
if ($module->hasJs()) {
|
||||
$this->redirectHttp('config/modules');
|
||||
} else {
|
||||
if ($module->hasCss()) {
|
||||
$this->reloadCss();
|
||||
}
|
||||
|
||||
$this->rerenderLayout()->redirectNow('config/modules');
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
|
@ -129,7 +129,7 @@ class JavaScript
|
||||
$request = Icinga::app()->getRequest();
|
||||
$noCache = $request->getHeader('Cache-Control') === 'no-cache' || $request->getHeader('Pragma') === 'no-cache';
|
||||
|
||||
header('Cache-Control: public');
|
||||
header('Cache-Control: public,no-cache,must-revalidate');
|
||||
|
||||
if (! $noCache && FileCache::etagMatchesFiles($files)) {
|
||||
header("HTTP/1.1 304 Not Modified");
|
||||
|
@ -192,7 +192,7 @@ class StyleSheet
|
||||
|
||||
$request = $styleSheet->app->getRequest();
|
||||
$response = $styleSheet->app->getResponse();
|
||||
$response->setHeader('Cache-Control', 'public', true);
|
||||
$response->setHeader('Cache-Control', 'private,no-cache,must-revalidate', true);
|
||||
|
||||
$noCache = $request->getHeader('Cache-Control') === 'no-cache' || $request->getHeader('Pragma') === 'no-cache';
|
||||
|
||||
|
@ -111,10 +111,7 @@
|
||||
var $oldLink = $(this);
|
||||
if ($oldLink.hasAttr('type') && $oldLink.attr('type').indexOf('css') > -1) {
|
||||
var base = location.protocol + '//' + location.host;
|
||||
var url = icinga.utils.addUrlParams(
|
||||
$(this).attr('href'),
|
||||
{ id: new Date().getTime() }
|
||||
);
|
||||
var url = $(this).attr('href');
|
||||
|
||||
var $newLink = $oldLink.clone().attr(
|
||||
'href',
|
||||
|
Loading…
x
Reference in New Issue
Block a user