Season metadata (playoff flag, season names, dates)
The provider_league_id in schema.sql is the client_code value (e.g., echl, gojhl).
Cache TTLs
Data
TTL
Full season schedule
30 minutes
Teams
24 hours
Seasons metadata
24 hours
Past games
7 days
Today’s games
30 minutes
Tomorrow’s games
4 hours
3-7 days out
8 hours
8+ days out
24 hours
Special Behaviors
Full schedule caching: get_team_schedule() fetches the entire season once, then filters locally
Lookback: Scans 7 days back to resolve .last template variables
Thread-safe: Connection pooling with configurable limits
Season type via seasons view: HockeyTech’s schedule feed leaves game_type empty for every game, but each game has a season_id. The separate seasons view is joined in to map season_id → canonical season_type: playoff == "1" → postseason; season_name containing preseason / pre-season / exhibition → preseason; anything else → regular.