From a1dd4e69fae49cc2aff58ab8789fb13fcecdd7c1 Mon Sep 17 00:00:00 2001 From: jason5ng32 Date: Wed, 31 Jul 2024 19:44:42 +0800 Subject: [PATCH 1/7] Improvements --- vercel.json | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 vercel.json diff --git a/vercel.json b/vercel.json deleted file mode 100644 index d18448c1..00000000 --- a/vercel.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "installCommand": "npm install", - "buildCommand": "npm run build", - "headers": [ - { - "source": "/(.*)", - "headers": [ - { - "key": "X-Frame-Options", - "value": "DENY" - }, - { - "key": "X-XSS-Protection", - "value": "1; mode=block" - }, - { - "key": "X-Content-Type-Options", - "value": "nosniff" - }, - { - "key": "Referrer-Policy", - "value": "no-referrer-when-downgrade" - } - ] - } - ] -} \ No newline at end of file From 1338d24784f7eac67b6f43b908bd0a4a64024339 Mon Sep 17 00:00:00 2001 From: jason5ng32 Date: Thu, 1 Aug 2024 18:55:44 +0800 Subject: [PATCH 2/7] Improvements --- frontend/components/WebRtcTest.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/components/WebRtcTest.vue b/frontend/components/WebRtcTest.vue index 35eff5d3..f4e7f499 100644 --- a/frontend/components/WebRtcTest.vue +++ b/frontend/components/WebRtcTest.vue @@ -67,9 +67,9 @@ const stunServers = reactive([ natType: t('webrtc.StatusWait'), }, { - id: "nextcloud", - name: "NextCloud (QUIC)", - url: "stun.nextcloud.com:443", + id: "blackberry", + name: "BlackBerry", + url: "stun.voip.blackberry.com:3478", ip: t('webrtc.StatusWait'), natType: t('webrtc.StatusWait'), }, From 5469a131075ab8554b3ba06c6994fca6b8d5aa36 Mon Sep 17 00:00:00 2001 From: jason5ng32 Date: Fri, 2 Aug 2024 01:40:24 +0800 Subject: [PATCH 3/7] Improvements --- frontend/components/ConnectivityTest.vue | 7 +++---- frontend/locales/en.json | 3 ++- frontend/locales/fr.json | 3 ++- frontend/locales/zh.json | 3 ++- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/frontend/components/ConnectivityTest.vue b/frontend/components/ConnectivityTest.vue index f96f3fb0..854349f5 100644 --- a/frontend/components/ConnectivityTest.vue +++ b/frontend/components/ConnectivityTest.vue @@ -17,7 +17,7 @@
-

{{ test.name }}

+

{{ test.name }}

Date: Thu, 8 Aug 2024 01:04:46 +0800 Subject: [PATCH 4/7] Improvements --- .../advanced-tools/InvisibilityTest.vue | 75 +++++++++++-------- .../components/advanced-tools/MacChecker.vue | 2 +- 2 files changed, 45 insertions(+), 32 deletions(-) diff --git a/frontend/components/advanced-tools/InvisibilityTest.vue b/frontend/components/advanced-tools/InvisibilityTest.vue index bbedbb13..f3f0d0a6 100644 --- a/frontend/components/advanced-tools/InvisibilityTest.vue +++ b/frontend/components/advanced-tools/InvisibilityTest.vue @@ -85,11 +85,12 @@ - - + {{ t('invisibilitytest.blocklist.proxy') }} - {{ t('invisibilitytest.blocklist.notProxy') }} + {{ + t('invisibilitytest.blocklist.notProxy') }} @@ -100,10 +101,11 @@ - - {{ + + {{ t('invisibilitytest.headers.proxy') }} - {{ t('invisibilitytest.headers.notProxy') }} + {{ + t('invisibilitytest.headers.notProxy') }} @@ -114,13 +116,14 @@ - - + {{ t('invisibilitytest.datacenter.proxy') }} {{ testResults.datacenter.hosting }} - {{ t('invisibilitytest.datacenter.notProxy') }} + {{ + t('invisibilitytest.datacenter.notProxy') }} @@ -131,8 +134,8 @@ - - + + {{ t('invisibilitytest.tcp.proxy') }}
{{ t('invisibilitytest.tcp.computer') }} @@ -142,7 +145,8 @@ {{ testResults.tcp.ipos }}
- {{ t('invisibilitytest.tcp.notProxy') }} + {{ t('invisibilitytest.tcp.notProxy') + }} @@ -153,8 +157,9 @@ - - + + {{ t('invisibilitytest.timezone.proxy') }}
{{ t('invisibilitytest.timezone.computer') }} @@ -162,7 +167,8 @@ {{ t('invisibilitytest.timezone.server') }} {{ testResults.timezone.iptimezone }}
- {{ t('invisibilitytest.timezone.notProxy') }} + {{ + t('invisibilitytest.timezone.notProxy') }} @@ -173,10 +179,12 @@ - - {{ t('invisibilitytest.net.proxy') + + {{ + t('invisibilitytest.net.proxy') + }} + {{ t('invisibilitytest.net.notProxy') }} - {{ t('invisibilitytest.net.notProxy') }} @@ -187,8 +195,8 @@ - - + + {{ t('invisibilitytest.webrtc.proxy') }}
{{ t('invisibilitytest.webrtc.ipsAre') }} @@ -198,7 +206,8 @@ }},
{{ testResults.webrtc.ip }}
- {{ t('invisibilitytest.webrtc.notProxy') }} + {{ t('invisibilitytest.webrtc.notProxy') + }} @@ -209,10 +218,12 @@ - - {{ t('invisibilitytest.flow.proxy') + + {{ + t('invisibilitytest.flow.proxy') + }} + {{ t('invisibilitytest.flow.notProxy') }} - {{ t('invisibilitytest.flow.notProxy') }} @@ -223,8 +234,8 @@ - - + + {{ t('invisibilitytest.latency.proxy') }}
{{ t('invisibilitytest.latency.fromTCP') }} @@ -233,7 +244,8 @@ {{ t('invisibilitytest.latency.fromWS') }} {{ testResults.latency.wsTime }}ms
- {{ t('invisibilitytest.latency.notProxy') }} + {{ + t('invisibilitytest.latency.notProxy') }} @@ -244,10 +256,11 @@ - - {{ + + {{ t('invisibilitytest.highlatency.proxy') }} - {{ t('invisibilitytest.highlatency.notProxy') }} + {{ + t('invisibilitytest.highlatency.notProxy') }} @@ -338,7 +351,7 @@ const getResult = async () => { if (data.message === "Data not found" && retryCount.value < 3) { setTimeout(() => { getResult(); - }, 4000, retryCount.value++ ); + }, 4000, retryCount.value++); return; } testResults.value = data; diff --git a/frontend/components/advanced-tools/MacChecker.vue b/frontend/components/advanced-tools/MacChecker.vue index 3b09be09..bfa9edb5 100644 --- a/frontend/components/advanced-tools/MacChecker.vue +++ b/frontend/components/advanced-tools/MacChecker.vue @@ -65,9 +65,9 @@ {{ t('macchecker.country') }} - {{ getCountryName(macCheckResult.country, lang) }} + {{ getCountryName(macCheckResult.country, lang) }}

From dce1c490e5cc0ffbe1250593d4d5a4c7a9732abe Mon Sep 17 00:00:00 2001 From: jason5ng32 Date: Thu, 8 Aug 2024 01:48:40 +0800 Subject: [PATCH 5/7] Improvements --- package.json | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index e8b78194..b1c612a0 100644 --- a/package.json +++ b/package.json @@ -14,31 +14,31 @@ "dependencies": { "@analytics/google-analytics": "^1.0.7", "@cloudflare/speedtest": "^1.3.0", - "@khmyznikov/pwa-install": "^0.3.9", - "analytics": "^0.8.13", + "@khmyznikov/pwa-install": "^0.4.3", + "analytics": "^0.8.14", "bootstrap": "^5.3.3", "bootstrap-icons": "^1.11.3", - "code-inspector-plugin": "^0.14.2", + "code-inspector-plugin": "^0.15.2", "concurrently": "^8.2.2", "country-code-lookup": "^0.1.3", "dotenv": "^16.4.5", "express": "^4.19.2", - "express-rate-limit": "^7.3.1", + "express-rate-limit": "^7.4.0", "express-slow-down": "^2.0.3", "flag-icons": "^7.2.3", "http-proxy-middleware": "^3.0.0", - "maxmind": "^4.3.20", + "maxmind": "^4.3.21", "nodemon": "^3.1.4", - "pinia": "^2.1.7", - "svgmap": "^2.10.1", - "vue": "^3.4.31", + "pinia": "^2.2.1", + "svgmap": "^2.11.1", + "vue": "^3.4.36", "vue-i18n": "^9.13.1", - "vue-router": "^4.4.0", - "whoiser": "^1.17.3" + "vue-router": "^4.4.3", + "whoiser": "^1.18.0" }, "devDependencies": { - "@vitejs/plugin-vue": "^5.0.5", - "vite": "^5.3.3", - "vite-plugin-pwa": "^0.20.0" + "@vitejs/plugin-vue": "^5.1.2", + "vite": "^5.4.0", + "vite-plugin-pwa": "^0.20.1" } } From 5dc9272f133c815a12a12fb196b457de331bfbf6 Mon Sep 17 00:00:00 2001 From: jason5ng32 Date: Thu, 8 Aug 2024 02:25:38 +0800 Subject: [PATCH 6/7] Update Cache Strategy --- vite.config.js | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/vite.config.js b/vite.config.js index e1dc9061..e1784915 100644 --- a/vite.config.js +++ b/vite.config.js @@ -25,6 +25,41 @@ export default defineConfig({ globPatterns: [ '**/*.{js,css,html,woff,woff2}', '*.{js,css,html,png,svg,jpg,webp}', + ], + runtimeCaching: [ + { + urlPattern: /\.(?:png|jpg|jpeg|svg|webp|woff|woff2)$/, // 图片文件 + handler: 'CacheFirst', + options: { + cacheName: 'images', + expiration: { + maxEntries: 60, + maxAgeSeconds: 7 * 24 * 60 * 60, // 7 天 + }, + }, + }, + { + urlPattern: /\.(?:js|css)$/, // JS 和 CSS 文件 + handler: 'StaleWhileRevalidate', + options: { + cacheName: 'assets', + expiration: { + maxEntries: 30, + maxAgeSeconds: 3 * 24 * 60 * 60, // 3 天 + }, + }, + }, + { + urlPattern: /\/$/, // HTML + handler: 'NetworkFirst', + options: { + cacheName: 'html', + expiration: { + maxEntries: 10, + maxAgeSeconds: 3 * 24 * 60 * 60, // 3 天 + }, + }, + } ] }, manifest: { @@ -53,7 +88,7 @@ export default defineConfig({ }, ], }, - }), + }), CodeInspectorPlugin({ bundler: 'vite', hideDomPathAttr: true, From 364571cf4139c2abafc97fbaa0250acef08e6b0d Mon Sep 17 00:00:00 2001 From: jason5ng32 Date: Thu, 8 Aug 2024 02:34:01 +0800 Subject: [PATCH 7/7] Update Cache Strategy --- vite.config.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/vite.config.js b/vite.config.js index e1784915..c54f6eb5 100644 --- a/vite.config.js +++ b/vite.config.js @@ -27,6 +27,17 @@ export default defineConfig({ '*.{js,css,html,png,svg,jpg,webp}', ], runtimeCaching: [ + { + urlPattern: /\/(sw\.js|registerSW\.js|manifest\.webmanifest)$/, // sw 文件 + handler: 'NetworkFirst', + options: { + cacheName: 'critical-assets', + expiration: { + maxEntries: 3, + maxAgeSeconds: 4 * 60 * 60, // 4 小时 + }, + }, + }, { urlPattern: /\.(?:png|jpg|jpeg|svg|webp|woff|woff2)$/, // 图片文件 handler: 'CacheFirst',