Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance 改善 #22

Open
chaspy opened this issue Jan 28, 2021 · 5 comments
Open

Performance 改善 #22

chaspy opened this issue Jan 28, 2021 · 5 comments

Comments

@chaspy
Copy link
Contributor

chaspy commented Jan 28, 2021

Google Page Speed Insight の結果
https://developers.google.com/speed/pagespeed/insights/

mobile

Screen Shot 2021-01-28 at 14 30 20

Screen Shot 2021-01-28 at 14 30 30

desktop

Screen Shot 2021-01-28 at 14 31 02

mobile が渋い。

@chaspy
Copy link
Contributor Author

chaspy commented Jan 28, 2021

mobile の opportunities

Screen Shot 2021-01-28 at 14 32 45

@chaspy
Copy link
Contributor Author

chaspy commented Jan 30, 2021

Netlify での Assets Optimization

Screen Shot 2021-01-31 at 3 39 38

無効になってたので有効にした

Before

Screen Shot 2021-01-31 at 3 41 02

After

Screen Shot 2021-01-31 at 3 45 06

custom.css と dark.css はサイズ小さくなった。(Time 伸びとるが。。。)フォントがかなり軽くなった。

@chaspy
Copy link
Contributor Author

chaspy commented Jan 30, 2021

Netlify CDN

初回アクセス時にキャッシュが効いてない気がする。
Screen Shot 2021-01-31 at 3 56 27

Netlify は Default で CDN が使われているが、日本の エッジは Enterprise Plan でしか使えないらしく、一番近いのはシンガポールのようだ。
速度を考えると別の CDN を使うとか考えたほうがいいが、今のところ Netlify の恩恵を受けたいので、キャッシュ設定を見直す。

https://dev.classmethod.jp/articles/learn-modern-browser-caching-strategy-from-netlify/

キャッシュはしてるけど、etag の検証走って変更なければ 304 で client 側から使える。
うーん。js とかは max-age 1年とかでいいと思うんだけどなあ。

@chaspy
Copy link
Contributor Author

chaspy commented Jan 30, 2021

Netlify の cache-control header 含む header のカスタマイズができるのでやってみてもいいかもしれない。
https://docs.netlify.com/routing/headers/#syntax-for-the-headers-file
Deploy 時に cache clear はできるので基本普段はキャッシュしといていいんではないか。

@chaspy
Copy link
Contributor Author

chaspy commented Jan 30, 2021

Hugo の Fingerprinting でいい感じにできそうである。
https://kamoqq.info/post/hugo-asset-fingerprinting/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant