Engineering
Why the first visitor waited five seconds
I timed two visits to the school website. With the old server already awake, it took about 800 milliseconds to send the first byte. After a quiet spell, the same request took 5.2 seconds. A parent looking up a date had to wait for a database connection and a fresh page.
Time until the first byte
Move the work off the request
The office changed the news a few times a day. Most visitors were asking for identical HTML. I started serving a saved copy and refreshing it in the background after the revalidation window. A visitor could read the previous edition while the server prepared the next.
The cached response took about 50 milliseconds in my comparison. That measures the start of the response. Images, fonts, and the rest of the page still have to reach the browser.
What the office gained
The office kept control over its news and event listings. The rebuilt platform cost 60 percent less per year to run. The important change for a family checking the website early in the morning was simpler. Being first no longer meant waking the server.
Read the school case study