Skip to content
Searching and booking on a phone: what really mattered

Searching and booking on a phone: what really mattered

· Bert Altena

Most visitors book on their phone. Search that counts what can really be booked, a map on your own aerial photo, and speed that is measured instead of guessed.

Most visitors to a booking platform I work on book on their phone. Everyone knows that, and yet a booking flow is often designed on a large screen and then made smaller.

These months it was worked on deliberately, always with the same question: what happens at 390 pixels wide, on a slow connection? Five things turned out to matter most.

Free days are not a bookable week

In high season, the offer looked empty. Anyone searching for a week found almost nothing.

The cause was in what the search counted: free days in the chosen window. But the venues rent out in blocks with fixed changeover days: a week of seven nights, a midweek of four nights from Monday, a weekend of three nights from Friday, or periods of their own. So "available" appeared at a place where the booking form refused those dates, and a place that would have worked a day later dropped out entirely.

Now the search lists, per place, the stays it really sells, using the same engine as the booking assistant, and picks the stay closest to the requested arrival, within some leeway. The result is available, available nearby (with the real dates and how many days it shifts) or booked. The leeway only moves the arrival day, never the length.

The visitor picks week, midweek, weekend or flexible. If the system recognises a clear pattern, say two or three nights arriving on a Friday, the choice switches to weekend by itself. A different length, such as nine nights, simply stays nine nights.

The spot map on your own drone photo

At places with several fishing spots, the visitor picks a spot on a map. That was a satellite map. Pretty, but heavy, and satellite images are often old or blurred.

Now each place can use its own aerial photo as the background. The owner crops it per device: desktop and tablet, phone portrait, phone landscape, with a warning as soon as an empty corner remains. The crop is stored in percentages, because the map area on the front grows with the screen. The pins are placed on the photo itself, separate from the GPS points, because a drone photo rarely faces exactly north or is to scale.

The best effect is invisible: with an aerial photo, the map library and the satellite images are no longer loaded at all. More than 120 KiB a phone does not have to fetch.

Measuring where a page loses its time

A fresh build of the country overview took 4.3 seconds, of which 0.7 seconds in the database. Nobody could say where the rest went.

So the build now sets measuring points per block: the list, the calendars, the filtering, the texts, the search panel, the maps. In the developer tools they are listed one under the other, and a slow build goes into a log with those points, even for an ordinary visitor.

Google's measurement also became easier to read. It reported that the page shifted, but never which element. Now every shift shows the element, its contribution and the cause. Notably, in an ordinary browser the shift was close to zero, at Google much higher. It only appeared on a throttled network and a slow processor, exactly the conditions of a phone.

A concrete gain: a page with a video put the full YouTube player in place straight away, which fetched more than a megabyte of scripts and styles for every visitor. Now there is a photo with a play button, and YouTube only loads when someone presses play.

A cache that never touches the booking

A page cache makes a site fast. On a booking site it is also dangerous. So three things were closed off before it was switched on.

A first visit receives a session cookie, and that is the same session in which the reservation will later be kept. A cache along the way that stores such a response as public hands the next visitor the session of the previous one. If there is a cookie in the response, it now goes out as private. The cache key knows the domain, so a page built for one language domain is never served on another. And the personal part, such as the welcome name and the cookie choice, sits on the browser side.

The booking module itself never comes from that cache. It always calculates on the server.

Upgrading a widget on someone else's site without breaking anything

The booking widget also runs on other people's websites, with their own styling. It was on an old version of Bootstrap. Upgrading is tricky when the surrounding site loads Bootstrap itself: two versions overwriting each other's rules.

The new version is a custom build of Bootstrap 5. All styling is scoped under the widget's own container, the scripts run under a name of their own and are tied to the widget's own copy of jQuery, and sizes were converted from rem to pixels, so a site with a different base size does not shrink the widget. The file is at the same address, so not a single embed code had to change.

Every screen was compared with screenshots of the old version, at 1280, 768 and 390 pixels wide, in four languages. The overview was pixel-identical. It was also tested on a site with its own Bootstrap 5 and a different font size, without any clash. At the same time, two known vulnerabilities of the old version disappeared.

What I take from this

None of these five was a new screen. They were corrections to what was already there, each found by looking at the phone under real conditions.

An earlier post was about what half a second of load time costs. This round mainly added one lesson: do not guess, measure. On the desktop, everything looked fine.

More of the platform is in the portfolio. If you want to know how your booking flow does on a phone, let me know via the contact page.

Frequently Asked Questions

Why did visitors find nothing in high season?
Because the search counted free days, while the venues rent out in fixed blocks with fixed changeover days. Free days do not mean that period can be booked. Now the system searches for stays that are really sold, with some leeway on the arrival day.
Is a page cache safe for a booking site?
Only with safeguards. A response that carries a session cookie must never be stored as public, the cache key must know the domain, and anything personal belongs on the browser side. The booking module itself never comes from the cache.
How do you upgrade a widget that runs on someone else's website?
By scoping the styling under its own container, putting the scripts under a name of their own so they do not clash with the surrounding site, and keeping the file at the same address. Then no embed code has to change.
Chat met ons