目的
Waiting Room の挙動について、図解があると助かるということで、例によって mermeid
でフローを書いてみます。
こちらの全体像を頭に入れておけば、使い始める際にスムーズに設定項目を理解できるはずです。
First In First Out (FIFO) のフロー
以下、解説です。
- Cloudflare Waiting Room は Cookie を活用したソリューションです。具体的には、リクエストは
__cfwaitingroom
Cookie によって、順番やセッション時間が管理されます。-
Cookies · Cloudflare Waiting Room docs
- Cloudflare Waiting Room requires the
__cfwaitingroom
cookie.
- Cloudflare Waiting Room requires the
- Waiting Room にいる間、Cookie の有効期限は常に 5 分に設定され、ブラウザタブを閉じない限り、20 秒ごとに自動更新されます。
- While a visitor stays in a waiting room, __cfwaitingroom cookie expiration is always set to five minutes, but renews every 20 seconds automatically as long as the visitor does not close the tab or leaves your application.
- Web アプリにいる間、Cookie の有効期限は Session Duration の値に基づき、設定されます。Session Renewal 無効時には、入場時からの絶対時間となり、Session Renewal 有効時には、最終リクエスト時刻からの相対時間となります。
- When the visitor accesses the application, the __cfwaitingroom cookie expires after an interval (specified by session_duration).
-
Cookies · Cloudflare Waiting Room docs
- 入場判定では、以下の2つの閾値がそれぞれ機能するため、どちらかが Threshold に達すれば Waiting Room に入ります
- 最大アクティブセッション数 (Total active users)
- 1分あたりの最大新規入場ユーザ数 (New users per minute)