Why caching matters for the booking form
The booking form loads dates, times and prices live while the guest books. The page also contains security tokens, called nonces, that WordPress creates for each page view. They expire after 12 to 24 hours.
If a cache serves an old copy of the page, the tokens in it have expired. Guests can still see activities, but price checks and the final Confirm Booking step fail. The form does not refresh the tokens by itself, so the guest has to reload the page.
Page caching
When a page shows the booking form, HarborBook tells WordPress caching plugins not to store it, using the standard DONOTCACHEPAGE signal. Most page cache plugins respect this, so you usually do not need to do anything in the plugin itself.
HarborBook does not send extra no-cache headers. Caches outside WordPress may ignore the signal, for example:
- caching built into your hosting,
- a CDN that caches whole HTML pages,
- a reverse proxy in front of your site.
In those, exclude every page that shows the booking form from caching. After you change payment or form settings, clear all caches so guests get the new version.
Logged-in visitors see their own name and email pre-filled in the form. This is one more reason a booking page must never be served from a shared cache.
admin-ajax.php and the REST API
The form talks to your site in two ways:
- The WordPress REST API, under /wp-json/harborbook/v1/, to load activities, dates, times, extras and pickup locations.
- admin-ajax.php in /wp-admin/, to calculate prices and to confirm the booking.
Both must be reachable for visitors who are not logged in. If a security plugin, firewall or host rule blocks them, guests see messages such as “Failed to load activities.” or “Failed to load available dates.”, or the form stops at the last step. Allow both paths, and allow requests to them from logged-out visitors.
Script optimisation
The form is built with React and uses WordPress’s own copies of react, react-dom and wp-i18n, plus its own file booking-widget.min.js. It loads in the footer.
If you use a plugin that delays, combines or removes JavaScript, exclude these scripts. If the form area stays empty on the page, test with the optimisation switched off first.
Assets load only where the form is
HarborBook loads its stylesheet and scripts only on pages and posts that contain the shortcode or the HarborBook block, or where the form was actually shown, for example from a theme template or page builder. Other pages on your site carry no HarborBook files. The bundled Inter font is only loaded when you choose it under HarborBook → Settings → Appearance.
Behind a CDN or proxy
HarborBook limits how many checkouts one visitor can start at once and how many payment attempts they can make in a short time. It identifies visitors by IP address. Behind a CDN or proxy, every visitor can appear to have the proxy’s address, so the limits apply to everyone together.
If your CDN passes the real visitor address in a header, name that header in wp-config.php. For Cloudflare:
define( 'HARBORBOOK_TRUSTED_PROXY_HEADER', 'HTTP_CF_CONNECTING_IP' );
Only set this when all traffic really comes through that CDN.