Waiting Room

Queue management for high-traffic events.


Overview

The Waiting Room feature manages traffic during high-demand periods like flash sales, ticket releases, or product launches. When your site reaches capacity, visitors are placed in a virtual queue and admitted in order.


How It Works

  1. Visitor arrives at your site
  2. Check capacity - Are there available slots?
  3. If available: Visitor enters immediately with a session cookie
  4. If full: Visitor is placed in queue with a position
  5. Queue page: Shows position and estimated wait time
  6. Admission: When slots open, queued visitors are admitted in order
  7. Session active: Visitor can browse until session expires or they leave

Enabling Waiting Room

From Dashboard

  1. Go to your zone settings
  2. Click "Waiting Room" tab
  3. Enable "Waiting Room"
  4. Configure settings
  5. Save changes

Key Settings

Setting Default Description
Max Active Users 200 Maximum concurrent active sessions
Session Duration 300s How long an active session lasts
Queue Timeout 900s How long a queue entry is valid
Inactivity Timeout 90s Time without activity before slot is freed

Configuration

Capacity Settings

Total Active Users: Maximum visitors who can be on your site simultaneously.

Consider your origin server's capacity:

  • Small server: 50-100 users
  • Medium server: 200-500 users
  • Large server: 1000+ users

Session Duration: How long a visitor's session lasts once admitted.

  • 5 minutes (300s): Short sessions, more turnover
  • 15 minutes (900s): Standard browsing
  • 30 minutes (1800s): Complex purchases

Queue Settings

Queue Timeout: How long a queue position remains valid. Visitors who don't check back within this time lose their spot.

Inactivity Timeout: How long an active session can be idle before the slot is freed for others. We detect activity through automatic heartbeats.


Bypass Rules

IP Bypass

Allow specific IPs to skip the queue:

192.168.1.100      # Office IP
10.0.0.0/24        # Internal network

Use for:

  • Admin access
  • Monitoring services
  • VIP customers

Path Bypass

Allow certain paths to skip the queue:

/api/*             # API endpoints
/webhooks/*        # Webhook handlers
/health            # Health checks
/_next/*           # Static assets (Next.js)

Cookie Bypass

Allow visitors with specific cookies to skip:

vip_access         # VIP cookie
admin_session      # Admin cookie

Queue Page Customization

Branding

  • Title: Custom heading (e.g., "Almost there!")
  • Message: Custom message explaining the wait
  • Logo URL: Your logo image URL

Default Queue Page

Shows:

  • Queue position
  • Estimated wait time
  • Auto-refresh countdown
  • Animated loading indicator

How Sessions Work

Session Token

Visitors receive a signed cookie (wr_{zone_uuid}) containing:

  • Session ID
  • Timestamp
  • Cryptographic signature

This prevents queue jumping or token forgery.

Heartbeat

Active visitors send automatic heartbeats every 30 seconds via JavaScript. This:

  • Confirms the visitor is still on the site
  • Keeps their session active
  • Detects when visitors leave

Departure Detection

When a visitor closes the tab, we detect it via:

  1. sendBeacon API on page unload
  2. Missing heartbeats after inactivity timeout

Departed visitors free their slot for queued users.


Preparing for High-Traffic Events

Before the Event

  1. Estimate traffic: How many visitors do you expect?
  2. Set capacity: Configure max active users below your server limit
  3. Test the flow: Verify queue page and admission work
  4. Pre-cache pages: Request key pages to warm the cache
  5. Notify users: Tell customers about the queue system

During the Event

  1. Monitor queue length: Watch for excessive wait times
  2. Adjust capacity: Increase if your server can handle more
  3. Watch errors: Check for origin errors or timeouts

After the Event

  1. Disable waiting room if not needed
  2. Review metrics: Check queue lengths and wait times
  3. Optimize: Adjust settings for next time

Monitoring

Dashboard Metrics

View real-time statistics:

  • Current active sessions
  • Current queue length
  • Average wait time
  • Sessions admitted per minute

API Access

# Get waiting room status
curl "https://nordiccdn.com/api/v1/zones/{uuid}/waiting-room/stats" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Response:

{
  "active_sessions": 187,
  "max_sessions": 200,
  "queue_length": 342,
  "avg_wait_seconds": 180
}

Best Practices

1. Set Realistic Capacity

Don't set max users higher than your origin can handle. The goal is to protect your server, not maximize throughput.

2. Use Short Sessions

Shorter sessions (5-10 minutes) allow more visitors through during peak times. Combine with good UX to help visitors complete tasks quickly.

3. Pre-Cache Important Pages

Before high-traffic events, warm your cache:

# Pre-cache product pages
curl https://yoursite.com/product/sale-item
curl https://yoursite.com/checkout

4. Bypass Static Assets

Always bypass waiting room for:

  • CSS and JavaScript files
  • Images
  • Fonts
  • API endpoints (if they have their own rate limiting)

5. Test Before Events

Run a load test with waiting room enabled to verify:

  • Queue page displays correctly
  • Admission works properly
  • Session tracking functions

Troubleshooting

Visitors Not Being Queued

  1. Verify waiting room is enabled
  2. Check if visitor IP is in bypass list
  3. Confirm path isn't in bypass list
  4. Check that visitor doesn't have bypass cookie

Queue Position Not Updating

  1. Ensure JavaScript is enabled
  2. Check for browser extensions blocking requests
  3. Verify network connectivity
  4. Try refreshing the page

Sessions Expiring Too Fast

  1. Check inactivity timeout setting
  2. Verify heartbeat script is loading
  3. Check for JavaScript errors in console

Origin Overloaded Despite Waiting Room

  1. Reduce max active users
  2. Shorten session duration
  3. Check bypass rules aren't too permissive
  4. Verify all traffic goes through CDN