idealclover / Life-in-NJU

🏠 南哪指南—南哪大学网址导航
https://nju.today/
MIT License
205 stars 41 forks source link

App: improve performance and security #12

Closed HermitSun closed 4 years ago

HermitSun commented 4 years ago
  1. Improve Performance Before:NT3_8___7_8B~ERBN__@2LN.png After:_B8__HSZJ`_Q8_L3J_VK`O0.png 1.95KB reduction (after gzip).
  2. Improve Security Avoid opener attacks ( did not consider IE compatibility, yet).
vercel[bot] commented 4 years ago

This pull request is being automatically deployed with Vercel (learn more). To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/idealclover/life-in-nju/hut6vb1gh ✅ Preview: https://life-in-nju-git-fork-hermitsun-master.idealclover.now.sh

idealclover commented 4 years ago

我去了解下~如果没有问题的话晚上流量低峰的时候合进来www

HermitSun commented 4 years ago

如果要考虑IE兼容性,可能需要这么写:

function open(url) {
 let tab = window.open();
 tab.opener = null;
 tab.location = url;
}

但是我觉得没太大必要……因为vuetify本身对IE的兼容就有点问题,只到IE11,再往下也没啥意思了。有IE11用户可以考虑一下。

HermitSun commented 4 years ago

压缩了一下背景图片,大概减小50%左右吧,可以稍微缓解一下首屏图片加载的问题

idealclover commented 4 years ago

好滴好滴~ 我昨天查了一下应该是没啥问题,半夜合并~

图片的话因为实际上用的是我自己的CDN嘛,这边合并完我要重新传一下~

另外关于加载的话,其实理想情况应该是图片在页面加载完毕之后加载...但是现在是把图片下载下来才会开始渲染好像,导致速度上有点问题...傻翠翠不是搞技术的性能上就不太搞的定了orz如果可以的话欢迎来帮帮忙ww

idealclover commented 4 years ago

Merged, thanks!