Trauringspezialisten is a German wedding ring chain. Through AMG Dynamics I finished its new Magento shop and took it live on 11 October 2026. Before that, while the shop still ran on its staging server, I measured diamond search. A single visit took 24 seconds.
That's the page where a shopper picks the stone for an engagement ring, from a feed of diamonds the shop imports. It isn't held in Magento's full page cache, so every visit built the page from scratch, and every visit paid the whole cost again.
Three blocks asking the same question
The page is assembled from blocks, and three of them needed search results: the filters, the list of stones and a script block. Each one ran the search itself. They were all asking for exactly the same thing, with the same filters and the same page of results, so every visit ran one search three times.
There was more. Before any of them searched, the code counted the entire diamond table, just to confirm it wasn't empty. On a table that size a count is a full scan, and each search did its own work on top of it: count the matches, then fetch the sorted page. Every one of those steps took seconds.
None of the blocks was badly written. Each one made sense on its own, and you could read any of them and find nothing wrong. The cost only showed when I followed one request from start to finish and added it up.
Answer once, keep it for an hour
The fix works inside a request and across requests. Inside a request, the first block that asks runs the search and keeps the result in memory, and the other blocks get that same result back. Across requests, the result goes into Magento's app cache for an hour, keyed on the store, the exact filters and the page. The core of it, trimmed:
if (isset($this->searched[$key])) {
return $this->searched[$key];
}
$cached = $this->cache->load($key);
if (is_string($cached) && $cached !== '') {
return $this->searched[$key] = $this->serializer->unserialize($cached);
}
$result = $this->fetchFromDb($filters, $page, $perPage);
$this->cache->save($this->serializer->serialize($result), $key, [TileDiamondPrices::CACHE_TAG], self::DB_LIFETIME);
return $this->searched[$key] = $result;The empty table check doesn't count the table any more either. It reads a count the shop's config already keeps cached. On top of all of this there's a page warmer.
Why it can't show a sold stone
Caching search results on a stock feed has an obvious risk. A shopper sees a diamond that has already been sold, picks it for a ring, and finds out too late. For a shop that sells engagement rings, that would be worse than a slow page.
So I didn't give the cached results a tag of their own. They're saved under the tag the shop already uses for the diamond prices on its product tiles, and the feed import already clears that tag every time it runs. A change to the price markup clears it too. When the stock changes, every cached search goes with it, and the next visit searches the fresh table.
That meant writing no invalidation logic at all. The clearing was already happening, for the prices. I only had to find it and put the search results under it. If I'd invented a new tag, I'd also have owned the job of remembering to clear it, on every path that changes stock, forever.
The numbers, and what I check first now
- Before: 24 seconds per visit.
- Cold, the first visit after an import clears the cache: 6 seconds.
- Cached: 0.3 seconds.
I quote the cold number as well as the cached one. 6 seconds is still slow, and it's what the first search for a set of filters costs once an import has cleared the cache or the hour has run out. It's the cost of one real search on the full table, once, instead of the same search three times on every visit. The cached 0.3 seconds is what every search after that one gets.
When a search page is slow now, the first thing I do, before I touch an index or rewrite a query, is count how many times one visit asks the question. A trace of a single request shows it. Here most of the cost came from how often the query ran, far more often than anyone meant it to. A faster query would have made each repeat cheaper and left every repeat in place.
The same shop has other numbers with their own write ups: the product page HTML that went from 4.7 MB to 1.9 MB, and a mobile score of 92 that I won't round up. There's also a note on how I write up a speed fix, with the before, the after and the method.
I do this kind of work through AMG Dynamics for jewellers and through Horizon Beam for everyone else. The site speed service explains how I go about it, and the Trauringspezialisten case study has the rest of that launch.