mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 05:19:39 +02:00
feat(cache): introduce cache option [EE-6293] (#10672)
Co-authored-by: testa113 <testa113>
This commit is contained in:
parent
57ed6ae6a6
commit
4096bb562d
71 changed files with 421 additions and 49 deletions
|
@ -2,6 +2,7 @@ import { Terminal } from 'xterm';
|
|||
import * as fit from 'xterm/lib/addons/fit/fit';
|
||||
import { csrfInterceptor, csrfTokenReaderInterceptorAngular } from './portainer/services/csrf';
|
||||
import { agentInterceptor } from './portainer/services/axios';
|
||||
import { dispatchCacheRefreshEventIfNeeded } from './portainer/services/http-request.helper';
|
||||
|
||||
/* @ngInject */
|
||||
export function configApp($urlRouterProvider, $httpProvider, localStorageServiceProvider, $uibTooltipProvider, $compileProvider, cfpLoadingBarProvider) {
|
||||
|
@ -9,6 +10,14 @@ export function configApp($urlRouterProvider, $httpProvider, localStorageService
|
|||
$compileProvider.debugInfoEnabled(false);
|
||||
}
|
||||
|
||||
// ask to clear cache on mutation
|
||||
$httpProvider.interceptors.push(() => ({
|
||||
request: (reqConfig) => {
|
||||
dispatchCacheRefreshEventIfNeeded(reqConfig);
|
||||
return reqConfig;
|
||||
},
|
||||
}));
|
||||
|
||||
localStorageServiceProvider.setPrefix('portainer');
|
||||
|
||||
$httpProvider.defaults.headers.post['Content-Type'] = 'application/json';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue