Native ESM proxy
リモート開発サーバでフロントエンド開発の速度が遅くて辛い
Native ESM だとリクエスト数が多くてしんどい
https://scrapbox.io/files/6609275fd6603600251f380b.png
リクエストをまとめる proxy server があるとよさそう!!と考えた
ボトルネックを真面目に考える
あるファイルについて注目すると↓こういう時間配分になっている
https://scrapbox.io/files/66092813dbd3fb002423786c.png
アバウトすぎてわからん
curl で詳しく計測する
リモートサーバ内で計測
code:console
$ curl -o /dev/null -w "Timing Analysis:\n Name Lookup: %{time_namelookup}s\n Connection Established: %{time_connect}s\n SSL/SSH Handshake Completed: %{time_appconnect}s\n Pre-transfer Phase Completed: %{time_pretransfer}s\n Redirect Time: %{time_redirect}s\n Time to First Byte: %{time_starttransfer}s\n Total Time: %{time_total}s\n" "http://localhost:3000/src/providers/index.tsx" Timing Analysis:
Name Lookup: 0.345242s
Connection Established: 0.345337s
SSL/SSH Handshake Completed: 0.000000s
Pre-transfer Phase Completed: 0.345362s
Redirect Time: 0.000000s
Time to First Byte: 0.346550s
Total Time: 0.346585s
クライアント機で計測( Windows )
code:console
$ curl.exe -o NUL -w "Timing Analysis:n Name Lookup: %{time_namelookup}sn Connection Established: %{time_connect}sn SSL/SSH Handshake Completed: %{time_appconnect}sn Pre-transfer Phase Completed: %{time_pretransfer}sn Redirect Time: %{time_redirect}sn Time to First Byte: %{time_starttransfer}sn Total Time: %{time_total}sn" "http://localhost:3000/src/providers/index.tsx" Timing Analysis:
Name Lookup: 0.013751s
Connection Established: 0.014046s
SSL/SSH Handshake Completed: 0.000000s
Pre-transfer Phase Completed: 0.014094s
Redirect Time: 0.000000s
Time to First Byte: 0.023657s
Total Time: 0.023707s
さて見比べると…
なんで windows のほうが早いんだよ
遅い原因をかんがえる…