Dynamic Recommendations Without a Rebuild
Author: WebGoodPeople
If your "Recommended" block keeps surfacing sold-out items, the problem usually isn't the design. The problem is that recommendations get baked in at build or cache time and stop reflecting reality.
Why static recommendations break conversion
When recommendations are built ahead of time, they:
- ignore current stock levels
- don't know the user's context right now
- react poorly to changes in assortment and prices
- force the team to rebuild pages just to refresh data
The fix: recommendations via API, in real time
Instead of treating recommendations as part of the page, treat them as a service:
- a front-end widget requests recommendations over an API
- the service factors in stock, availability, and rules
- you can personalize by user and scenario
- you can cache briefly (30–120 seconds) without rebuilding pages
What to send to the API (the minimum)
For recommendations to be useful, this is usually enough:
user_id/session_id(or an anonymous key)context(page, category, product)exclude_ids(for example, the current product)limitrequest_id(for correlation)
How to ship it safely, without regressions
Recommendations are part of conversion, so control matters:
- staged rollout (a slice of traffic, then all of it)
- metric comparison (block CTR, add-to-cart, conversion)
- fast rollback via a feature flag
Why request_id is critical here
When recommendations run through a chain of front end, API, database or search, you're guessing without correlation. One request_id across the whole path lets you:
- reconstruct the full request end to end
- see where the time goes
- fix incidents and regressions faster
Integration checklist
- Split the recommendations block into a separate API call.
- Add stock and availability awareness.
- Add a
request_idand minimal logging. - Set up a feature flag plus staged rollout.
- Record before/after metrics.
Next step
If you want to roll out dynamic recommendations without the risk, start with a pilot.
Product: Headless Next.js + Elasticsearch