The challenge
A rates page was one of the most visited on the site, but the numbers were updated by hand and were often stale. Fetching live data on every page view would have collapsed under the traffic.
Objectives
- Publish current rates without manual updating
- Survive traffic spikes without slowing the site
- Degrade gracefully when the source is unavailable
- Let editors place the rates anywhere
What we built
A plugin that fetches rates on a schedule, caches aggressively through the transients layer, and serves the cached figures to visitors, with a shortcode and block so editors can place the table anywhere.
Technology
PHP · REST · Transients API · WordPress
How it was delivered
- Scheduled fetch with transient caching between runs
- Graceful fallback to the last known values on source failure
- Shortcode and block for editor placement
- Display formatting for multiple units and purities
- Admin controls for refresh interval and manual override
Outcomes
- Rates update without an editor doing anything
- The page stays fast under traffic spikes
- Source outages no longer show empty values to readers
- Editors can place the table on any page
