<?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>Forem: Alejandro</title>
    <description>The latest articles on Forem by Alejandro (@aserrano).</description>
    <link>https://forem.com/aserrano</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3678599%2F279e4266-e77b-4ffd-8147-29247cbee9b8.png</url>
      <title>Forem: Alejandro</title>
      <link>https://forem.com/aserrano</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/aserrano"/>
    <language>en</language>
    <item>
      <title>How Rate Limiting Saved Me $500 in One Day (Real Story)</title>
      <dc:creator>Alejandro</dc:creator>
      <pubDate>Mon, 29 Dec 2025 20:15:00 +0000</pubDate>
      <link>https://forem.com/aserrano/how-rate-limiting-saved-me-500-in-one-day-real-story-ajp</link>
      <guid>https://forem.com/aserrano/how-rate-limiting-saved-me-500-in-one-day-real-story-ajp</guid>
      <description>&lt;p&gt;4 AM. Phone buzzes. Cloudflare alert: "Worker exceeded daily request limit."&lt;/p&gt;

&lt;p&gt;I check the dashboard. &lt;strong&gt;500,000 requests in 2 hours.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;My free tier Worker just got hammered. And I had no rate limiting.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Happened
&lt;/h2&gt;

&lt;p&gt;Someone (or something) found my API endpoint and started hitting it. Hard.&lt;/p&gt;

&lt;p&gt;Without rate limiting:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Every request went through&lt;/li&gt;
&lt;li&gt;My D1 database got slammed&lt;/li&gt;
&lt;li&gt;I hit the 100k/day limit by noon&lt;/li&gt;
&lt;li&gt;Had to upgrade to paid plan immediately&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Cost:&lt;/strong&gt; $5/month plan + overage fees = ~$50 that month.&lt;/p&gt;

&lt;p&gt;But it could have been worse. Much worse.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Fix: Rate Limiting
&lt;/h2&gt;

&lt;p&gt;I implemented this the same day:&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="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;RateLimiter&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@cloudflare/workers-rate-limiter&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="na"&gt;request&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Env&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Response&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;limiter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;RateLimiter&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="c1"&gt;// 100 requests per minute per IP&lt;/span&gt;
      &lt;span class="na"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;period&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;clientIP&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;CF-Connecting-IP&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;success&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;limiter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;limit&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;clientIP&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;

    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;success&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Response&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Too many requests&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; 
        &lt;span class="na"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;429&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Retry-After&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;60&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="c1"&gt;// Normal request handling&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;handleRequest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The Impact
&lt;/h2&gt;

&lt;p&gt;Next time the bot came back:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First 100 requests went through&lt;/li&gt;
&lt;li&gt;Everything else got 429&lt;/li&gt;
&lt;li&gt;My costs stayed normal&lt;/li&gt;
&lt;li&gt;Database didn't get slammed&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Lessons Learned
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Rate limiting is not optional for production&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;100 req/min is usually enough for legitimate users&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Return 429 with Retry-After header&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Monitor rate limit hits&lt;/strong&gt; (they tell you about bots)&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Different Strategies
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Per IP:&lt;/strong&gt;&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;CF-Connecting-IP&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Per User:&lt;/strong&gt;&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`user-&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Per Endpoint:&lt;/strong&gt;&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;clientIP&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;-&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;pathname&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The Math
&lt;/h2&gt;

&lt;p&gt;That attack would have cost me:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Without rate limiting: $500+ in compute costs&lt;/li&gt;
&lt;li&gt;With rate limiting: $5 monthly plan&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;ROI of 10 lines of code: $495.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Bottom Line
&lt;/h2&gt;

&lt;p&gt;Don't deploy to production without rate limiting. Ever.&lt;/p&gt;

&lt;p&gt;I learned this lesson expensively. You don't have to.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My complete rate limiting template&lt;/strong&gt; (plus 8 other production-ready templates) is in my deployment guide for $29: &lt;a href="https://appybot.gumroad.com/l/oatoe" rel="noopener noreferrer"&gt;https://appybot.gumroad.com/l/oatoe&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Have you been hit by a bot attack? What happened?&lt;/p&gt;

</description>
      <category>cloudflarechallenge</category>
      <category>security</category>
      <category>webdev</category>
      <category>performance</category>
    </item>
    <item>
      <title>Speed Up Your Worker with Cache API (5 Lines of Code)</title>
      <dc:creator>Alejandro</dc:creator>
      <pubDate>Mon, 29 Dec 2025 10:05:12 +0000</pubDate>
      <link>https://forem.com/aserrano/speed-up-your-worker-with-cache-api-5-lines-of-code-3d96</link>
      <guid>https://forem.com/aserrano/speed-up-your-worker-with-cache-api-5-lines-of-code-3d96</guid>
      <description>&lt;p&gt;Want to make your Worker 10x faster?&lt;/p&gt;

&lt;p&gt;Cache API is your friend. Here's how to use it in 5 lines:&lt;/p&gt;

&lt;h2&gt;
  
  
  The Code
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="na"&gt;request&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Response&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;cache&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;caches&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;default&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;// Try to get from cache first&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;cache&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;match&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="c1"&gt;// Cache miss - fetch from origin&lt;/span&gt;
      &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

      &lt;span class="c1"&gt;// Cache for 1 hour&lt;/span&gt;
      &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Response&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Cache-Control&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;max-age=3600&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

      &lt;span class="c1"&gt;// Store in cache&lt;/span&gt;
      &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;cache&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;put&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;clone&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it. 5 lines (the important ones).&lt;/p&gt;

&lt;h2&gt;
  
  
  What This Does
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Checks if response is in cache&lt;/li&gt;
&lt;li&gt;If yes → returns cached version (super fast)&lt;/li&gt;
&lt;li&gt;If no → fetches from origin&lt;/li&gt;
&lt;li&gt;Stores in cache for next time&lt;/li&gt;
&lt;li&gt;Returns response&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The Impact
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Before caching:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Every request hits your origin&lt;/li&gt;
&lt;li&gt;Response time: 200-500ms&lt;/li&gt;
&lt;li&gt;High CPU usage&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;After caching:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cached requests return in &amp;lt;10ms&lt;/li&gt;
&lt;li&gt;70-90% cache hit rate is common&lt;/li&gt;
&lt;li&gt;Minimal CPU usage&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Real Numbers
&lt;/h2&gt;

&lt;p&gt;On my API:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;P50 latency: 450ms → 15ms&lt;/li&gt;
&lt;li&gt;P95 latency: 800ms → 25ms&lt;/li&gt;
&lt;li&gt;Cache hit rate: 85%&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Pro Tips
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Only cache GET requests&lt;/li&gt;
&lt;li&gt;Set appropriate TTL (don't cache forever)&lt;/li&gt;
&lt;li&gt;Use cache keys for different variants&lt;/li&gt;
&lt;li&gt;Invalidate cache when data changes&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Cache API is built into Workers. No setup. No cost. Just speed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Want more performance patterns?&lt;/strong&gt; I've got caching strategies, database optimization, and more in my complete guide: &lt;a href="https://appybot.gumroad.com/l/oatoe" rel="noopener noreferrer"&gt;https://appybot.gumroad.com/l/oatoe&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cloudflarechallenge</category>
      <category>webdev</category>
      <category>performance</category>
      <category>node</category>
    </item>
    <item>
      <title>This CORS Mistake Exposes Your API (I See It Everywhere)</title>
      <dc:creator>Alejandro</dc:creator>
      <pubDate>Sat, 27 Dec 2025 09:40:57 +0000</pubDate>
      <link>https://forem.com/aserrano/this-cors-mistake-exposes-your-api-i-see-it-everywhere-58cb</link>
      <guid>https://forem.com/aserrano/this-cors-mistake-exposes-your-api-i-see-it-everywhere-58cb</guid>
      <description>&lt;p&gt;Saw this in 70% of Workers I've reviewed:&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="nx"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Access-Control-Allow-Origin&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;*&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Access-Control-Allow-Credentials&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;true&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Looks harmless, right?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It's a security hole.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;When you use wildcard (&lt;code&gt;*&lt;/code&gt;) with credentials, you're telling browsers:&lt;/p&gt;

&lt;p&gt;"Allow ANY website to make authenticated requests to my API."&lt;/p&gt;

&lt;p&gt;This means malicious sites can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Read user data&lt;/li&gt;
&lt;li&gt;Make requests on behalf of logged-in users&lt;/li&gt;
&lt;li&gt;Steal session tokens&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Fix
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Option 1: Use specific origins&lt;/strong&gt;&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;allowedOrigins&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://yourdomain.com&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://app.yourdomain.com&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;origin&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Origin&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;allowedOrigins&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;includes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;origin&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Access-Control-Allow-Origin&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;origin&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Access-Control-Allow-Credentials&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;true&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Option 2: Don't use credentials&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you don't need cookies/auth headers:&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="nx"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Access-Control-Allow-Origin&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;*&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// No credentials header at all&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The Rule
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Wildcard OR credentials. Never both.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Simple as that.&lt;/p&gt;

&lt;p&gt;Have you made this mistake? Don't worry—so have I. And pretty much everyone else when they started.&lt;/p&gt;

</description>
      <category>cloudflarechallenge</category>
      <category>security</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>5 Critical Mistakes I Made Deploying Cloudflare Workers to Production (And How to Avoid Them)</title>
      <dc:creator>Alejandro</dc:creator>
      <pubDate>Thu, 25 Dec 2025 18:06:27 +0000</pubDate>
      <link>https://forem.com/aserrano/5-critical-mistakes-i-made-deploying-cloudflare-workers-to-production-and-how-to-avoid-them-2ji7</link>
      <guid>https://forem.com/aserrano/5-critical-mistakes-i-made-deploying-cloudflare-workers-to-production-and-how-to-avoid-them-2ji7</guid>
      <description>&lt;h1&gt;
  
  
  5 Critical Mistakes I Made Deploying Cloudflare Workers to Production (And How to Avoid Them)
&lt;/h1&gt;

&lt;p&gt;I've deployed over 50 Cloudflare Workers to production. And honestly? I've made every mistake &lt;br&gt;
in the book.&lt;/p&gt;

&lt;p&gt;Some were minor annoyances. Others were costly. One mistake cost my company an entire morning &lt;br&gt;
of downtime. Another exposed a security vulnerability I didn't catch until a user reported it.&lt;/p&gt;

&lt;p&gt;But each mistake taught me something. And after years of learning (the hard way), I finally &lt;br&gt;
have a system that works.&lt;/p&gt;

&lt;p&gt;Today, I want to share the mistakes I made—and how you can avoid them.&lt;/p&gt;


&lt;h2&gt;
  
  
  Mistake #1: Deploying Without a Security Checklist
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What I did:&lt;/strong&gt; &lt;br&gt;
Built a Worker, tested it locally, and deployed. Seemed fine.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I missed:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No CORS configuration (browser blocked requests)&lt;/li&gt;
&lt;li&gt;No rate limiting (got slammed with requests)&lt;/li&gt;
&lt;li&gt;No security headers (exposed to XSS attacks)&lt;/li&gt;
&lt;li&gt;Secrets hardcoded in environment... wait, actually, I was paranoid enough to use Cloudflare 
Secrets, but I didn't validate input&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;The consequence:&lt;/strong&gt;&lt;br&gt;
My API got hit with a flood of requests. No rate limiting = crashed. Then a user reported &lt;br&gt;
they could inject malicious data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to avoid it:&lt;/strong&gt;&lt;br&gt;
Create a security checklist BEFORE deploying:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ CORS configured for your domain only (not wildcard)&lt;/li&gt;
&lt;li&gt;✅ Rate limiting enabled&lt;/li&gt;
&lt;li&gt;✅ Input validation on all endpoints&lt;/li&gt;
&lt;li&gt;✅ Security headers set (HSTS, CSP, etc.)&lt;/li&gt;
&lt;li&gt;✅ Secrets in Cloudflare (not code)&lt;/li&gt;
&lt;li&gt;✅ JWT tokens have expiration&lt;/li&gt;
&lt;li&gt;✅ Error messages don't leak system info&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I now use a checklist for every single deployment. Takes 10 minutes. Saves countless headaches.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;This is exactly why I created a 7-checklist system&lt;/strong&gt; (plus production-ready code templates) &lt;br&gt;
for deploying Workers safely. Security is just one of them. &lt;a href="https://appybot.gumroad.com/l/oatoe" rel="noopener noreferrer"&gt;Get the complete guide for $29 →&lt;/a&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  Mistake #2: Not Testing Performance Before Production
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What I did:&lt;/strong&gt;&lt;br&gt;
Built locally, tested in staging, deployed to production.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I missed:&lt;/strong&gt;&lt;br&gt;
My database queries were slow. My caching wasn't configured. I didn't realize some endpoints &lt;br&gt;
took 2+ seconds to respond.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The consequence:&lt;/strong&gt;&lt;br&gt;
Users complained about slowness. My CF Workers bill was higher than expected (unnecessary &lt;br&gt;
database calls). I had to rollback and optimize.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to avoid it:&lt;/strong&gt;&lt;br&gt;
Before deploying:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Test response time under load (not just locally)&lt;/li&gt;
&lt;li&gt;Check P95 latency (not just average)&lt;/li&gt;
&lt;li&gt;Profile database queries&lt;/li&gt;
&lt;li&gt;Implement caching for repeated requests&lt;/li&gt;
&lt;li&gt;Verify bundle size is under 1MB&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A simple &lt;code&gt;console.time()&lt;/code&gt; during development would have caught this immediately.&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="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;time&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;db-query&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;users&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;DB&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;prepare&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;SELECT * FROM users&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;all&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;timeEnd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;db-query&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// Output: db-query: 145ms&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;I learned this the hard way&lt;/strong&gt;, which is why I included a complete performance checklist and &lt;br&gt;
a caching template in my deployment guide. &lt;a href="https://appybot.gumroad.com/l/oatoe" rel="noopener noreferrer"&gt;Check it out → $29&lt;/a&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  Mistake #3: Forgetting to Set Up Proper Logging
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What I did:&lt;/strong&gt;&lt;br&gt;
Deployed, assumed it would work, didn't set up any monitoring.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I missed:&lt;/strong&gt;&lt;br&gt;
When something broke, I had no idea what happened. No logs. No error tracking. Just... nothing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The consequence:&lt;/strong&gt;&lt;br&gt;
Spent 2 hours debugging blindly. Could have found the issue in 5 minutes with proper logs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to avoid it:&lt;/strong&gt;&lt;br&gt;
Set up logging from day one:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ Enable Workers Logs in wrangler.toml&lt;/li&gt;
&lt;li&gt;✅ Structured logging (JSON format)&lt;/li&gt;
&lt;li&gt;✅ Include RequestID for tracing&lt;/li&gt;
&lt;li&gt;✅ Log different levels (DEBUG, INFO, WARN, ERROR)&lt;/li&gt;
&lt;li&gt;✅ Set up alerts for high error rates&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;logger&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Logger&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;requestId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;randomUUID&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
  &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;pathname&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;method&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Request received&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;endpoint&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/api/users&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="c1"&gt;// Output: {"timestamp":"2025-12-25T...", "level":"INFO", "message":"Request received", ...}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I've since built a structured logging template and included it in my guide. Along with &lt;br&gt;
monitoring, health checks, and everything else you need. &lt;a href="https://appybot.gumroad.com/l/oatoe" rel="noopener noreferrer"&gt;Get $29 access →&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Mistake #4: Not Having a Rollback Plan
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What I did:&lt;/strong&gt;&lt;br&gt;
Deployed a broken version and panicked when it broke production.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I missed:&lt;/strong&gt;&lt;br&gt;
I had no idea how to quickly revert to the previous version. My fix took 30 minutes because &lt;br&gt;
I was scrambling.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The consequence:&lt;/strong&gt;&lt;br&gt;
30 minutes of downtime for users. Lost trust. Could have been 2 minutes with a practiced &lt;br&gt;
rollback procedure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to avoid it:&lt;/strong&gt;&lt;br&gt;
Before deploying to production:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Know the rollback command by heart: &lt;code&gt;wrangler rollback DEPLOYMENT_ID&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Test it in staging first&lt;/li&gt;
&lt;li&gt;Document it in your team's runbook&lt;/li&gt;
&lt;li&gt;Practice it (seriously, do a test rollback)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A 5-minute practice session saves 30 minutes of panic later.&lt;/p&gt;




&lt;h2&gt;
  
  
  Mistake #5: Not Documenting What You Did
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What I did:&lt;/strong&gt;&lt;br&gt;
Deployed a critical update, didn't document the changes, didn't tell my team.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I missed:&lt;/strong&gt;&lt;br&gt;
My coworker deployed an hour later without knowing about my changes. Created a conflict.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The consequence:&lt;/strong&gt;&lt;br&gt;
Confused config, broken deployment, rolled back my changes, had to redeploy the next day.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to avoid it:&lt;/strong&gt;&lt;br&gt;
Create a deployment checklist for your team:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What changed?&lt;/li&gt;
&lt;li&gt;Why did it change?&lt;/li&gt;
&lt;li&gt;What to watch for?&lt;/li&gt;
&lt;li&gt;How to rollback?&lt;/li&gt;
&lt;li&gt;Who deployed it?&lt;/li&gt;
&lt;li&gt;When?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A 5-minute deployment log saves hours of confusion later.&lt;/p&gt;




&lt;h2&gt;
  
  
  The System That Works
&lt;/h2&gt;

&lt;p&gt;After all these mistakes, I finally developed a system:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Before deployment:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Use a pre-deployment checklist (configuration, secrets, database)&lt;/li&gt;
&lt;li&gt;Use a security checklist (auth, CORS, headers, validation)&lt;/li&gt;
&lt;li&gt;Use a performance checklist (caching, queries, bundle size)&lt;/li&gt;
&lt;li&gt;Use a testing checklist (unit, integration, staging)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;During deployment:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Use a deployment-day checklist (health checks, metrics, alerts)&lt;/li&gt;
&lt;li&gt;Monitor continuously for 24 hours&lt;/li&gt;
&lt;li&gt;Watch error rate and response time&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;After deployment:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Use a post-deployment checklist (logs, metrics, team notification)&lt;/li&gt;
&lt;li&gt;Document what changed&lt;/li&gt;
&lt;li&gt;Celebrate (you earned it)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This system has eliminated 95% of my production issues. Now when things do break, they're &lt;br&gt;
caught immediately and fixed in minutes instead of hours.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Boring But Necessary Truth
&lt;/h2&gt;

&lt;p&gt;Deployments aren't glamorous. Checklists aren't exciting. But they work.&lt;/p&gt;

&lt;p&gt;The best teams I've worked with weren't the smartest. They were the most disciplined.&lt;/p&gt;

&lt;p&gt;They had checklists. They followed them. They rarely had incidents.&lt;/p&gt;

&lt;p&gt;And when something did go wrong? They had a plan. Fixed it in minutes. Moved on.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;That's why I spent time compiling all of this into one guide.&lt;/strong&gt; Not to sell you something, &lt;br&gt;
but because I genuinely believe every developer should have this. It includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ 25-page production deployment guide&lt;/li&gt;
&lt;li&gt;✅ 7 printable checklists (ready to print and tape to your desk)&lt;/li&gt;
&lt;li&gt;✅ 9 production-ready code templates&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For just $29. &lt;a href="https://appybot.gumroad.com/l/oatoe" rel="noopener noreferrer"&gt;Get it here →&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Where to Start
&lt;/h2&gt;

&lt;p&gt;If you're reading this and thinking "yeah, I should probably have a system..."&lt;/p&gt;

&lt;p&gt;Here's what I recommend:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Print a security checklist&lt;/strong&gt; and tape it to your monitor&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Create a simple deployment checklist&lt;/strong&gt; for your team (or grab one from my guide)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Set up one alert&lt;/strong&gt; in Cloudflare for high error rates&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test a rollback&lt;/strong&gt; once&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Takes 1 hour. Could save you from a 6-month security nightmare.&lt;/p&gt;

&lt;p&gt;Or, if you want everything ready to go, &lt;a href="https://appybot.gumroad.com/l/oatoe" rel="noopener noreferrer"&gt;grab the complete guide for $29 →&lt;/a&gt; &lt;br&gt;
It has all the templates, checklists, and code examples already done.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;I learned these lessons through expensive mistakes. You don't have to.&lt;/p&gt;

&lt;p&gt;The smartest move isn't writing perfect code on the first try. It's creating a system that &lt;br&gt;
catches mistakes before they hit production.&lt;/p&gt;

&lt;p&gt;Checklists. Monitoring. Logging. Rollback procedures.&lt;/p&gt;

&lt;p&gt;Boring? Maybe. But your ops team will love you. Your users won't experience outages. Your &lt;br&gt;
CEO won't yell at you.&lt;/p&gt;

&lt;p&gt;Worth it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Have you made any of these mistakes? What did you learn?&lt;/strong&gt; Let me know in the comments—I'd &lt;br&gt;
love to hear about your deployment war stories.&lt;/p&gt;

&lt;p&gt;And if you're looking for a complete system to avoid these issues, &lt;a href="https://appybot.gumroad.com/l/oatoe" rel="noopener noreferrer"&gt;I've put together &lt;br&gt;
everything here for $29 →&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  What's Inside the Guide
&lt;/h2&gt;

&lt;p&gt;Since I keep mentioning it, here's what you actually get for $29:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Guide:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;25 pages of production deployment knowledge&lt;/li&gt;
&lt;li&gt;Everything from pre-deployment config to post-deployment monitoring&lt;/li&gt;
&lt;li&gt;Real errors and how to solve them&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;The Code:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;9 production-ready TypeScript templates

&lt;ul&gt;
&lt;li&gt;JWT Authentication&lt;/li&gt;
&lt;li&gt;CORS Handler&lt;/li&gt;
&lt;li&gt;Rate Limiting&lt;/li&gt;
&lt;li&gt;Caching Strategy&lt;/li&gt;
&lt;li&gt;Security Headers&lt;/li&gt;
&lt;li&gt;Structured Logging&lt;/li&gt;
&lt;li&gt;Input Validation&lt;/li&gt;
&lt;li&gt;Health Checks&lt;/li&gt;
&lt;li&gt;Complete Worker Setup&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;The Checklists:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;7 printable checklists (one for each phase)

&lt;ul&gt;
&lt;li&gt;Pre-Deployment&lt;/li&gt;
&lt;li&gt;Security&lt;/li&gt;
&lt;li&gt;Performance&lt;/li&gt;
&lt;li&gt;Testing&lt;/li&gt;
&lt;li&gt;Monitoring&lt;/li&gt;
&lt;li&gt;Deployment Day&lt;/li&gt;
&lt;li&gt;Post-Deployment&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;The Extras:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Configuration examples&lt;/li&gt;
&lt;li&gt;Complete troubleshooting guide&lt;/li&gt;
&lt;li&gt;FAQ with 20+ answered questions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Everything ready to use, customize, and scale.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://appybot.gumroad.com/l/oatoe" rel="noopener noreferrer"&gt;Get it for $29 →&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;30-day money-back guarantee if you're not satisfied.&lt;/p&gt;

</description>
      <category>cloudflarechallenge</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
