Sportland · Scandiweb · Backend engineer · 2025
Stopping a content edit from cold-starting the site
Narrowed cache invalidation, and price calculation off the request path
The problem
Two things were making pages slower than they needed to be. Prices were being calculated while the customer waited, and any content edit invalidated the entire site cache, so routine merchandising work repeatedly cold-started a 12-storefront platform. Neither looked like a bug. Both were paid for on every request.
What I did
For pricing I moved the calculation off the request path. On outfits, where the sort key is derived from the constituent items and so cannot be indexed directly, I added an indexer table to materialise the derived value and optimised the query that reads it. For caching I narrowed invalidation so an edit clears what it actually affects instead of everything.
The outcome
Page response time came down, and editing content stopped being an event that the whole platform had to recover from.
Built with
- PHP
- Magento 2
- MySQL
- Redis
- New Relic