+
@@ -257,8 +264,8 @@ const initData = (): Website.ProxyConfig => ({
operate: 'create',
enable: true,
cache: false,
- cacheTime: 4,
- cacheUnit: 'h',
+ cacheTime: 0,
+ cacheUnit: '',
name: '',
modifier: '',
match: '/',
@@ -272,7 +279,7 @@ const initData = (): Website.ProxyConfig => ({
proxySSLName: '',
serverCacheTime: 10,
serverCacheUnit: 'm',
- browserCache: false,
+ browserCache: 'noModify',
cors: false,
allowOrigins: '*',
allowMethods: 'GET,POST,OPTIONS,PUT,DELETE',
@@ -295,8 +302,12 @@ const acceptParams = (proxyParam: Website.ProxyConfig) => {
activeTab.value = 'basic';
// Initialize browserCache based on cacheTime value
- if (proxy.value.browserCache === undefined) {
- proxy.value.browserCache = proxy.value.cacheTime > 0;
+ if (proxy.value.cacheTime > 0) {
+ proxy.value.browserCache = 'enable';
+ } else if (proxy.value.cacheTime === 0) {
+ proxy.value.browserCache = 'noModify';
+ } else {
+ proxy.value.browserCache = 'disable';
}
const res = getProtocolAndHost(proxyParam.proxyPass);
@@ -326,11 +337,14 @@ const changeServerCache = (cache: boolean) => {
}
};
-const changeBrowserCache = (cache: boolean) => {
- proxy.value.browserCache = cache;
- if (cache) {
+const changeBrowserCache = (mode: 'enable' | 'disable' | 'noModify') => {
+ proxy.value.browserCache = mode;
+ if (mode === 'enable') {
proxy.value.cacheTime = 4;
proxy.value.cacheUnit = 'h';
+ } else if (mode === 'disable') {
+ proxy.value.cacheTime = -1;
+ proxy.value.cacheUnit = '';
} else {
proxy.value.cacheTime = 0;
proxy.value.cacheUnit = '';
diff --git a/frontend/src/views/website/website/config/basic/proxy/index.vue b/frontend/src/views/website/website/config/basic/proxy/index.vue
index e8fc69462b07..0d7446d85840 100644
--- a/frontend/src/views/website/website/config/basic/proxy/index.vue
+++ b/frontend/src/views/website/website/config/basic/proxy/index.vue
@@ -12,11 +12,11 @@
-
+
{{ $t('website.browserCache') + ':' }}
{{ row.cacheTime > 0 ? row.cacheTime + row.cacheUnit : $t('setting.sslDisable') }}
-
+
{{ $t('website.serverCache') + ':' }}
{{ row.serverCacheTime > 0 ? row.serverCacheTime + row.serverCacheUnit : $t('setting.sslDisable') }}