This post is a slightly revised version of a document I wrote about a year ago
to share some gentle technical planning guidance with colleagues. It’s not
intended to provide a template for writing technical design documents; every TD
is probably going to look a bit different, based on its scope and audience.
Instead, it’s a narrative around what you should think about in order to
write an effective TD, what you and others should be able to get out of it,
and some guidelines on how to get started with your tech spike and written
document.
Happy holidays! This article was written from a talk I gave at Web
Directions Developer Summit 2024, and originally
published as Day 18 of the 2024 Planet Performance Web Performance Advent
Calendar.
Thanks to John Allsopp for the idea, Stoyan Stefanov for the original platform,
and Barry Pollard for reviewing the article before publication!
Speculative
loading,
or navigation speculation, is the concept of predicting (speculating about)
which page a user might visit next and doing some or all of the work to load
that page before they visit it. This way, if the user does end up navigating to
the page, it appears to load much faster. Browsers have offered several types of
resource hints to enable speculation for many years, but many of these
interfaces have been clunky and inflexible to use. Google has recently
introduced the Speculation Rules API in Chromium, designed to make it easier to
prefetch and prerender documents for future navigations.