Daily content sites have an unusual traffic pattern: a burst at the daily reset, a long tail through the day, and almost nothing overnight. That pattern is close to ideal for static hosting, and yet most daily puzzle sites are served from a database. A static pipeline is simpler and faster.
The pipeline has three stages. First, a build step generates the day's puzzle and its answer page. Second, the output is committed to a branch or deployed to a bucket. Third, a scheduled job triggers the deploy. The site itself never runs a query at request time.
Two caching details make a measurable difference. The puzzle data files should be immutable per day and cached forever, keyed by date in the filename. The HTML shell can then be cached with a short TTL, because only the data file changes. That separation means a browser that has the shell only downloads a few kilobytes at reset time.
The second detail is cache busting that does not require a global purge. If the data filename includes the date, there is nothing to invalidate. The shell can point at the next date before midnight and the file appears when the deploy finishes. The result is a website that never needs a cache purge.
The build step is where all the logic lives, which is also where mistakes live. A common bug is building the answer page for a day that has not happened yet and publishing it early. The fix that has worked best for me is to generate everything but only deploy the full archive after the reset time, using a small scheduled job.
If you want to see the result, try today's puzzle is the live page and how the game works explains the format. The interesting part for engineers is that the site has no runtime dependencies at all: static files, a worker for routing, and a cron job that runs a build. Everything that looks like state is actually a file.
Top comments (0)