Start a conversation

innerpulseNotes

Pages that never compute on request

How NFL Stats stays fast under load by doing all of its analytics ahead of time, and why the same pattern suits most data-heavy websites.

NFL Stats is an analytics site with a lot going on: opponent-adjusted efficiency for every team, power ratings, player grades, a prediction model graded against the betting market and playoff odds from 10,000 simulated seasons. It is also fast, because none of that work happens when someone opens a page.

Split the work in two

The site is built as two separate programs. The first is an hourly Python ingest. It pulls play-by-play, Next Gen Stats and other feeds, and loads them into Oracle Autonomous Database. The models run there and then, and their results are written out as pre-warmed JSON. The second is the website, written in PHP, which only ever reads that JSON and renders it.

The web server never runs a query that depends on the visitor, never fits a model and never simulates a season. Its job is to turn finished numbers into HTML and SVG. That keeps response times flat whether ten people or ten thousand are looking, and it means a slow upstream feed can never make a page slow; at worst the numbers are an hour old.

Do the expensive math where nobody is waiting

Some of the analytics are genuinely heavy. Opponent adjustment is iterative: each team’s numbers depend on the strength of every opponent, whose numbers depend on theirs. Early in the season, when samples are small, results are pulled toward the league average. Playoff odds come from simulating the rest of the season 10,000 times with tiebreaker-correct standings.

Running that on request would be slow and wasteful, since the inputs only change when games are played. Running it on a schedule costs the same whether the site has one visitor or a million.

Record predictions before the outcome

Pre-computing has a second benefit that matters for any model: the prediction exists before the result. NFL Stats records each pick before kickoff and grades it afterward against the closing betting market, with the running record on the front page. Because the pick was written down ahead of time, nobody can quietly adjust it later.

Draw the charts, skip the libraries

Every chart on the site is generated, animated SVG, with no third-party scripts, fonts or CDNs. SVG stays sharp at any size, prints well and adds very little to the page. The same approach drives the charts on the Hunt Almanac and the maps on Connecticut Atlas.

When this pattern fits

  • The data changes on a schedule (hourly, daily, after each game or each filing) rather than with every visit.
  • Many people read the same numbers, so computing them once serves everyone.
  • Upstream sources are slow or unreliable, and the site should stay up when they are not.
  • Predictions or scores need an honest record, written down before the outcome.

It is the same idea behind Connecticut Atlas, which re-fetches its census, state and election sources daily, rebuilds its layers and redeploys itself, and behind innerpulse dashboard, whose twenty-eight dashboards run unattended on a 4K wall. Most data-heavy websites can be built this way, and most are faster, cheaper and sturdier for it.