فهرست منبع

主要更新:
* 常用网站静态资源 CDN 加速测试
* conf.js 格式调整,增加线路权重配置

zjcqoo 6 سال پیش
والد
کامیت
2806aded79
5فایلهای تغییر یافته به همراه41 افزوده شده و 28 حذف شده
  1. 1 1
      404.html
  2. 0 0
      assets/bundle.1eed1303.js
  3. 0 0
      assets/bundle.6fecf114.js
  4. 39 26
      conf.js
  5. 1 1
      sw.js

+ 1 - 1
404.html

@@ -1 +1 @@
-<html><head><meta charset=utf-8></head><body id=t><svg xmlns=http://www.w3.org/2000/svg width=100% height=100% viewBox="0 0 100 100"preserveAspectRatio=xMidYMid fill=none><circle cx=50 cy=50 r=25.944 stroke=#93dbe9><animate attributeName=r calcMode=spline values=0;40 keyTimes=0;1 dur=1 keySplines="0 0.2 0.8 1"begin=-0.5s repeatCount=indefinite stroke-width=2 /><animate attributeName=opacity calcMode=spline values=1;0 keyTimes=0;1 dur=1 keySplines="0.2 0 0.8 1"begin=-0.5s repeatCount=indefinite stroke-width=2 /></circle><circle cx=50 cy=50 r=40 stroke=#689cc5><animate attributeName=r calcMode=spline values=0;40 keyTimes=0;1 dur=1 keySplines="0 0.2 0.8 1"begin=0s repeatCount=indefinite stroke-width=2 /><animate attributeName=opacity calcMode=spline values=1;0 keyTimes=0;1 dur=1 keySplines="0.2 0 0.8 1"begin=0s repeatCount=indefinite stroke-width=2 /></circle></svg><script>function n(){var e=Date.now();try{var t=+sessionStorage._ts||0;if((sessionStorage._ts=e)-t<100)return setTimeout(n,5e3)}catch(r){}location.reload()}function r(e){a(e.message)}function a(e){t.innerHTML=e}!function o(){if(self.isSecureContext){var e=navigator.serviceWorker;e&&self.ReadableStream?e.register(function t(){return location.pathname.replace(/\/-+https?:.+/,"").replace(/\w+\.\w+$/,"").replace(/\/*$/,"/")}()+"sw.js").then(n)["catch"](r):a("请使用最新版 Chrome 浏览器访问")}else a("本程序需要 HTTPS 站点")}()</script></body></html>
+<html><head><meta charset=utf-8></head><body id=t><svg xmlns=http://www.w3.org/2000/svg width=100% height=100% viewBox="0 0 100 100"preserveAspectRatio=xMidYMid fill=none><circle cx=50 cy=50 r=25.944 stroke=#93dbe9><animate attributeName=r calcMode=spline values=0;40 keyTimes=0;1 dur=1 keySplines="0 0.2 0.8 1"begin=-0.5s repeatCount=indefinite stroke-width=2 /><animate attributeName=opacity calcMode=spline values=1;0 keyTimes=0;1 dur=1 keySplines="0.2 0 0.8 1"begin=-0.5s repeatCount=indefinite stroke-width=2 /></circle><circle cx=50 cy=50 r=40 stroke=#689cc5><animate attributeName=r calcMode=spline values=0;40 keyTimes=0;1 dur=1 keySplines="0 0.2 0.8 1"begin=0s repeatCount=indefinite stroke-width=2 /><animate attributeName=opacity calcMode=spline values=1;0 keyTimes=0;1 dur=1 keySplines="0.2 0 0.8 1"begin=0s repeatCount=indefinite stroke-width=2 /></circle></svg><script>function n(){var e=Date.now();try{var t=+sessionStorage._ts||0;if((sessionStorage._ts=e)-t<100)return setTimeout(n,5e3)}catch(r){}location.reload()}function r(e){o(e.message)}function o(e){t.innerHTML=e}!function s(){if(self.isSecureContext){var e=navigator.serviceWorker;e&&self.AbortController?e.register(function t(){return location.pathname.replace(/\/-+https?:.+/,"").replace(/\w+\.\w+$/,"").replace(/\/*$/,"/")}()+"sw.js").then(n)["catch"](r):o("请使用最新版 Chrome 浏览器访问")}else o("本程序需要 HTTPS 站点")}()</script></body></html>

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
assets/bundle.1eed1303.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
assets/bundle.6fecf114.js


+ 39 - 26
conf.js

@@ -1,46 +1,59 @@
 jsproxy_config({
-  // 当前配置的版本(服务端记录在日志中,方便排查问题)
-  ver: '55',
+  // 当前配置的版本(记录在日志中,用于排查问题)
+  ver: '73',
+
+  // 通过 CDN 加速常用网站的静态资源(实验中)
+  static_boost: {
+    enable: true,
+    ver: 18
+  },
 
   // 节点配置
   node_map: {
-    'aliyun-hk': {
+    'demo-hk': {
       label: '演示服务-香港节点',
-      lines: [
-        // 多条线路,负载均衡系统会从其中选一条
-        'node-aliyun-hk-0.etherdream.com:8443',
-        'node-aliyun-hk-1.etherdream.com:8443',
-        'node-aliyun-hk-2.etherdream.com:8443',
-      ]
+      lines: {
+        // 主机:权重
+        'node-aliyun-hk-0.etherdream.com:8443': 1,
+        'node-aliyun-hk-1.etherdream.com:8443': 1,
+        'node-aliyun-hk-2.etherdream.com:8443': 1,
+      }
     },
-    'aliyun-sg': {
+    'demo-sg': {
       label: '演示服务-新加坡节点',
-      lines: [
-        'node-aliyun-sg.etherdream.com:8443'
-      ]
+      lines: {
+        'node-aliyun-sg.etherdream.com:8443': 1,
+      },
     },
     'mysite': {
       label: '当前站点',
-      lines: [
-        // 静态资源和代理接口位于同个服务器的场合
-        // 例如默认的 ip.xip.io 以及 cloudflare worker
-        location.host
-      ]
+      lines: {
+        [location.host]: 1,
+      }
     },
+    // 该节点用于加载大体积的静态资源
     'cfworker': {
-      label: 'Cloudflare Worker',
+      label: '',
       hidden: true,
-      lines: [
-        // 实验中...
-        'node-cfworker.etherdream.com:8443'
-      ]
+      lines: {
+        // 收费版(高权重)
+        'node-cfworker.etherdream.com': 6,
+
+        // 免费版(低权重,分摊一些成本)
+        // 每个账号每天 10 万次免费请求,但有频率限制
+        'a.007.workers.dev': 1,
+        'a.hehe.workers.dev': 1,
+        'a.lulu.workers.dev': 1,
+        'shrill-unit-8594.jsproxy.workers.dev': 1,
+      }
     }
   },
 
   /**
    * 默认节点
    */
-  node_default: 'aliyun-hk',
+  // node_default: 'mysite',
+  node_default: /jsproxy\.\w+$/.test(location.host) ? 'demo-hk' : 'mysite',
 
   /**
    * 加速节点
@@ -51,10 +64,10 @@ jsproxy_config({
    * 静态资源 CDN 地址
    * 用于加速 `assets` 目录中的资源访问
    */
-  assets_cdn: 'https://cdn.jsdelivr.net/gh/zjcqoo/zjcqoo.github.io@master/assets/',
+  // assets_cdn: 'https://cdn.jsdelivr.net/gh/zjcqoo/zjcqoo.github.io@master/assets/',
 
   // 本地测试时打开,否则访问的是线上的
-  // assets_cdn: 'assets/',
+  assets_cdn: 'assets/',
 
   /**
    * 自定义注入页面的 HTML

+ 1 - 1
sw.js

@@ -1 +1 @@
-jsproxy_config=x=>{__CONF__=x;importScripts(__FILE__=x.assets_cdn+'bundle.6fecf114.js')};importScripts('conf.js')
+jsproxy_config=x=>{__CONF__=x;importScripts(__FILE__=x.assets_cdn+'bundle.1eed1303.js')};importScripts('conf.js')

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است