1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-19 05:19:39 +02:00

feat(cache): introduce cache option [EE-6293] (#10641)

This commit is contained in:
Ali 2023-11-20 10:22:48 +13:00 committed by GitHub
parent fffc7b364e
commit 2c032f1739
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
70 changed files with 418 additions and 45 deletions

View file

@ -1,6 +1,7 @@
import { Terminal } from 'xterm';
import * as fit from 'xterm/lib/addons/fit/fit';
import { agentInterceptor } from './portainer/services/axios';
import { dispatchCacheRefreshEventIfNeeded } from './portainer/services/http-request.helper';
/* @ngInject */
export function configApp($urlRouterProvider, $httpProvider, localStorageServiceProvider, jwtOptionsProvider, $uibTooltipProvider, $compileProvider, cfpLoadingBarProvider) {
@ -8,6 +9,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');
jwtOptionsProvider.config({