<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mike de Ruiter</title>
    <description>The latest articles on DEV Community by Mike de Ruiter (@mike_168aebe77b08ee9fb998).</description>
    <link>https://dev.to/mike_168aebe77b08ee9fb998</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4277104%2F44b4faf9-d805-4da2-82dc-80ee22899b33.png</url>
      <title>DEV Community: Mike de Ruiter</title>
      <link>https://dev.to/mike_168aebe77b08ee9fb998</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mike_168aebe77b08ee9fb998"/>
    <language>en</language>
    <item>
      <title>How I Built a Sub-200ms Dutch Game Price Comparison Engine on Cloudflare Workers, TanStack Start &amp; Streaming CSVs</title>
      <dc:creator>Mike de Ruiter</dc:creator>
      <pubDate>Tue, 01 Dec 2026 20:41:23 +0000</pubDate>
      <link>https://dev.to/mike_168aebe77b08ee9fb998/how-i-built-a-sub-200ms-dutch-game-price-comparison-engine-on-cloudflare-workers-tanstack-start--354f</link>
      <guid>https://dev.to/mike_168aebe77b08ee9fb998/how-i-built-a-sub-200ms-dutch-game-price-comparison-engine-on-cloudflare-workers-tanstack-start--354f</guid>
      <description>&lt;p&gt;Building a real-time price comparison site for video games in the Netherlands sounds straightforward until you have to normalize &lt;strong&gt;thousands of physical retail SKUs and digital keyshop feeds&lt;/strong&gt; inside strict edge compute limits—while keeping page loads fast enough for both gamers and search crawlers.&lt;/p&gt;

&lt;p&gt;Here is the real architecture behind &lt;strong&gt;&lt;a href="https://gocdkey.nl" rel="noopener noreferrer"&gt;Gocdkey.nl&lt;/a&gt;&lt;/strong&gt; (a Dutch game price comparator covering PlayStation 5, Nintendo Switch / Switch 2, Xbox, and PC across Dutch webshops like bol.com, Coolblue, Amazon.nl, MediaMarkt, Joybuy.nl, and digital keyshops) and three engineering lessons that paid off immediately.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Streaming 27,000+ Gzipped CSV Rows in &amp;lt; 2 Seconds
&lt;/h2&gt;

&lt;p&gt;Many affiliate product feeds (like Awin or Daisycon) ship a single gzipped CSV with tens of thousands of rows—most of them unrelated products (coffee machines, keyboards, board games). Buffering the entire CSV into memory in an Edge Function blows past memory and CPU budgets fast.&lt;/p&gt;

&lt;p&gt;Two tricks solved this cleanly:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Request only the exact CSV columns you need&lt;/strong&gt; in the Awin URL (dropping multi-kilobyte &lt;code&gt;description&lt;/code&gt; columns cuts payload size by ~70%).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pipe &lt;code&gt;fetch().body&lt;/code&gt; straight through &lt;code&gt;DecompressionStream('gzip')&lt;/code&gt; into a custom streaming CSV parser&lt;/strong&gt; that skips non-matching categories in &lt;code&gt;O(1)&lt;/code&gt; before allocating offer objects.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Result: our Joybuy.nl Awin console game feed (27,682 rows) downloads, decompresses, strictly matches 81 physical PS5/Switch/Xbox titles, upserts prices + shipping costs, and retires stale stock in &lt;strong&gt;1.9 seconds total&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Cutting SSR TTFB from 1.8s to ~180ms on Cloudflare Workers
&lt;/h2&gt;

&lt;p&gt;With TanStack Start SSR running on Cloudflare Workers, our game detail pages initially had two bottlenecks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A sequential database waterfall (&lt;code&gt;loadGame&lt;/code&gt; → &lt;code&gt;enrichDlc&lt;/code&gt; → &lt;code&gt;loadCommunity&lt;/code&gt;). Moving DLC enrichment into &lt;code&gt;Promise.all&lt;/code&gt; with an early exit for games without DLC shaved ~200ms off every cold render.&lt;/li&gt;
&lt;li&gt;Isolate-local in-memory caching meant each Cloudflare PoP isolate rebuilt pages independently. Adding a shared Cache API layer with &lt;strong&gt;stale-while-revalidate&lt;/strong&gt; (serving fresh for 60s, serving stale + refreshing in &lt;code&gt;ctx.waitUntil&lt;/code&gt; for 10 minutes across isolates, while keeping &lt;code&gt;noindex&lt;/code&gt; pages strictly fresh-only) brought live p50 response times down from &lt;strong&gt;1.80s to 124–236ms&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. Opening Up the Data (JSON, Markdown, MCP &amp;amp; Embeddable Widgets)
&lt;/h2&gt;

&lt;p&gt;Rather than locking prices behind HTML, every game page exposes the exact same underlying data in machine-readable formats—documented on our &lt;strong&gt;&lt;a href="https://gocdkey.nl/data" rel="noopener noreferrer"&gt;Open Data page&lt;/a&gt;&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Per-game JSON: &lt;code&gt;https://gocdkey.nl/api/v1/games/baldur-s-gate-3.json&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Steam AppID lookup (used by our open-source &lt;strong&gt;&lt;a href="https://github.com/Hatseflatsh/gocdkey-steam-extensie" rel="noopener noreferrer"&gt;Firefox &amp;amp; Edge browser extension&lt;/a&gt;&lt;/strong&gt;): &lt;code&gt;https://gocdkey.nl/api/v1/games/steam-1086940.json&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Top 50 current NL deals: &lt;code&gt;https://gocdkey.nl/api/v1/deals.json&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Weekly CSV snapshots on GitHub: &lt;strong&gt;&lt;a href="https://github.com/Hatseflatsh/nl-game-prijzen-dataset" rel="noopener noreferrer"&gt;nl-game-prijzen-dataset&lt;/a&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Model Context Protocol server: &lt;strong&gt;&lt;a href="https://github.com/Hatseflatsh/gocdkey-mcp" rel="noopener noreferrer"&gt;gocdkey-mcp&lt;/a&gt;&lt;/strong&gt; (&lt;code&gt;npx -y github:Hatseflatsh/gocdkey-mcp&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Zero-JS embeddable price cards for Dutch gaming blogs: &lt;code&gt;https://gocdkey.nl/widget&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Useful Pitfall: &lt;code&gt;NFKD&lt;/code&gt; + Trademark Symbols
&lt;/h2&gt;

&lt;p&gt;One bug worth sharing if you normalize product titles in JavaScript/TypeScript:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="s2"&gt;"Horizon: Zero Dawn™"&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;normalize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"NFKD"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;// =&amp;gt; "Horizon: Zero DawnTM"  &amp;lt;-- ™ expands to ASCII "TM"!&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Always strip &lt;code&gt;[™®©]&lt;/code&gt; &lt;strong&gt;before&lt;/strong&gt; calling &lt;code&gt;.normalize('NFKD')&lt;/code&gt;, otherwise titles like &lt;code&gt;Battlefield™ 6&lt;/code&gt; or &lt;code&gt;Horizon: Zero Dawn™ Remastered&lt;/code&gt; turn into &lt;code&gt;battlefieldtm 6&lt;/code&gt; and silently miss catalog matches.&lt;/p&gt;




&lt;p&gt;If you're building price trackers, e-commerce scrapers, or Dutch open-data projects—feel free to grab the &lt;strong&gt;&lt;a href="https://github.com/Hatseflatsh/nl-game-prijzen-dataset" rel="noopener noreferrer"&gt;CSV dataset on GitHub&lt;/a&gt;&lt;/strong&gt; or test the live JSON endpoints on &lt;strong&gt;&lt;a href="https://gocdkey.nl/data" rel="noopener noreferrer"&gt;Gocdkey.nl/data&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>cloudflare</category>
      <category>typescript</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
