<?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: Ankit Gupta</title>
    <description>The latest articles on DEV Community by Ankit Gupta (@ankit_gupta_37c6b9df66fb7).</description>
    <link>https://dev.to/ankit_gupta_37c6b9df66fb7</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%2F4129086%2F3846a1f2-2c5c-4522-a881-2e3f18c14e6b.png</url>
      <title>DEV Community: Ankit Gupta</title>
      <link>https://dev.to/ankit_gupta_37c6b9df66fb7</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ankit_gupta_37c6b9df66fb7"/>
    <language>en</language>
    <item>
      <title>On two of my three small sites, Bing sent 7-8x more clicks than Google</title>
      <dc:creator>Ankit Gupta</dc:creator>
      <pubDate>Mon, 23 Nov 2026 12:30:30 +0000</pubDate>
      <link>https://dev.to/ankit_gupta_37c6b9df66fb7/on-two-of-my-three-small-sites-bing-sent-7-8x-more-clicks-than-google-37m2</link>
      <guid>https://dev.to/ankit_gupta_37c6b9df66fb7/on-two-of-my-three-small-sites-bing-sent-7-8x-more-clicks-than-google-37m2</guid>
      <description>&lt;p&gt;I run three small sites: &lt;a href="https://360playzone.com" rel="noopener noreferrer"&gt;360 PlayZone&lt;/a&gt; (browser games that need no sign-up), &lt;a href="https://allsmartcalculators.com" rel="noopener noreferrer"&gt;AllSmartCalculators&lt;/a&gt; (finance and health calculators with a guide behind each one) and &lt;a href="https://resumebanao.app" rel="noopener noreferrer"&gt;ResumeBanao&lt;/a&gt; (an ATS resume checker and builder for Indian job seekers). I watch Google Search Console every week. I had never opened the Bing Webmaster Tools dashboard I set up months ago. This week I did, and the numbers surprised me.&lt;/p&gt;

&lt;h2&gt;
  
  
  The numbers (roughly the same 90 days, 25 Aug to 20 Nov 2026)
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Site&lt;/th&gt;
&lt;th&gt;Google clicks (Search Console)&lt;/th&gt;
&lt;th&gt;Bing clicks (Webmaster Tools)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;360 PlayZone&lt;/td&gt;
&lt;td&gt;about 125&lt;/td&gt;
&lt;td&gt;869 (46.8K impressions)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AllSmartCalculators&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;40 (5K impressions)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ResumeBanao&lt;/td&gt;
&lt;td&gt;about 27&lt;/td&gt;
&lt;td&gt;6 (778 impressions)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Two sites get 7 to 8 times more clicks from Bing than from Google. The third is the opposite. These are tiny absolute numbers, so read this as a pattern, not a law. But I would have missed it completely if I only looked at one dashboard.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I did about it
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. IndexNow for AllSmartCalculators.&lt;/strong&gt; The site already had an IndexNow key file and a small script, but Bing's dashboard still showed "Get started", so it had never verified. I ran the script. The first call returned &lt;code&gt;403 SiteVerificationNotCompleted&lt;/code&gt;; the same call a minute later returned success and submitted all 263 sitemap URLs. If you get that 403 on a brand new key, wait and retry before debugging your key file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. ResumeBanao: measuring my own thin pages.&lt;/strong&gt; Both engines were unhappy with the same thing. Google had left 411 of about 490 URLs as "Crawled - currently not indexed", and Bing's recommendations said "limited crawl capacity" and "too many pages with insufficient content". Impressions had also fallen from roughly 100 a day to near zero on 23 September, which lines up with a redirect loop my auth middleware sent Googlebot into (I wrote about that &lt;a href="https://dev.to/ankit_gupta_37c6b9df66fb7/my-auth-middleware-sent-googlebot-into-a-redirect-loop-my-health-checks-said-200-2be5"&gt;here&lt;/a&gt;) and with Google's September spam update. I can't prove which one did what.&lt;/p&gt;

&lt;p&gt;What I could measure was how similar my programmatic pages were. I fetched three pages per template family, stripped the markup, and compared overlapping 5-word shingles:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;shingles&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&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="n"&gt;w&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toLowerCase&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="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;\&lt;span class="no"&gt;W&lt;/span&gt;&lt;span class="o"&gt;+/&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Boolean&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Set&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="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&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="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="n"&gt;s&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;// overlap % = shared shingles / size of the smaller page's set&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Page family&lt;/th&gt;
&lt;th&gt;URLs&lt;/th&gt;
&lt;th&gt;Words per page&lt;/th&gt;
&lt;th&gt;Text shared with a sibling&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;role x industry resume templates&lt;/td&gt;
&lt;td&gt;200&lt;/td&gt;
&lt;td&gt;about 240&lt;/td&gt;
&lt;td&gt;48%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;role x city salary pages&lt;/td&gt;
&lt;td&gt;200&lt;/td&gt;
&lt;td&gt;about 700&lt;/td&gt;
&lt;td&gt;61%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;my real pages (Hindi resume format, walk-in resume)&lt;/td&gt;
&lt;td&gt;a handful&lt;/td&gt;
&lt;td&gt;380 to 930&lt;/td&gt;
&lt;td&gt;0 to 10%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Same word count on every page in a family is the giveaway: it is a template with variables swapped in.&lt;/p&gt;

&lt;p&gt;I kept those 400 pages reachable for visitors but set them to &lt;code&gt;noindex, follow&lt;/code&gt;, took them out of the sitemaps, and left only the two city salary pages that had actually earned clicks indexable. One constant flips them all back if I ever give each page its own content. I also stopped the Article JSON-LD on the thinnest family from claiming 650 words when the page has about 240.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two small lessons
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Bing's &lt;code&gt;site:&lt;/code&gt; operator is not a reliable index check. I ran it for all three domains, got unrelated results, and wrongly concluded Bing had indexed nothing. Webmaster Tools showed all three sites with thousands of impressions.&lt;/li&gt;
&lt;li&gt;If a template family has the same word count on every page, measure the overlap before you add more pages.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you build small sites, add them to Bing Webmaster Tools. It takes a few minutes and it showed me where my traffic was actually coming from.&lt;/p&gt;

</description>
      <category>seo</category>
      <category>webdev</category>
      <category>bing</category>
      <category>nextjs</category>
    </item>
    <item>
      <title>Half of Googlebot's requests to my Next.js site are for JavaScript. 176 pages were never crawled.</title>
      <dc:creator>Ankit Gupta</dc:creator>
      <pubDate>Sat, 14 Nov 2026 07:01:55 +0000</pubDate>
      <link>https://dev.to/ankit_gupta_37c6b9df66fb7/half-of-googlebots-requests-to-my-nextjs-site-are-for-javascript-176-pages-were-never-crawled-4321</link>
      <guid>https://dev.to/ankit_gupta_37c6b9df66fb7/half-of-googlebots-requests-to-my-nextjs-site-are-for-javascript-176-pages-were-never-crawled-4321</guid>
      <description>&lt;p&gt;I run two small Next.js sites on the same host. Google indexes neither of them well, and this week I read the crawl stats for both instead of guessing. They fail in opposite ways.&lt;/p&gt;

&lt;h2&gt;
  
  
  Site one: a calculator site, robots.txt allows everything
&lt;/h2&gt;

&lt;p&gt;Search Console, crawl stats, last 90 days:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;total crawl requests      988
average response time     173 ms
by response               200: 97 %    404: 2 %
by purpose                refresh: 100 %
by file type              JavaScript 50 %   HTML 37 %   CSS 7 %   image 4 %
by Googlebot type         page resource load 57 %   smartphone 34 %
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And the Pages report:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;indexed                                  32
discovered - currently not indexed      176
crawled - currently not indexed          40
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Read together: Google made 988 requests in three months, and more than half of them were not pages. They were the scripts and stylesheets it needs to render pages it already knows. About 37 % were HTML, which is roughly 365 page fetches in 90 days, four a day, for a sitemap of 263 URLs. Every request was a refresh of something known. None went to discovering anything new, and 176 URLs sit in "discovered" with no crawl date at all.&lt;/p&gt;

&lt;p&gt;Nothing is broken. The server answers in 173 ms, nothing is blocked, the sitemap is read. Google gives this site a very small allowance and spends more than half of it on JavaScript.&lt;/p&gt;

&lt;h2&gt;
  
  
  Site two: a resume builder, robots.txt blocked /_next/
&lt;/h2&gt;

&lt;p&gt;Same host, same framework, and one line that had been in robots.txt since May: &lt;code&gt;Disallow: /_next/&lt;/code&gt;. It was there to keep "infrastructure" out of search. &lt;code&gt;/_next/static&lt;/code&gt; is where every stylesheet and script lives.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;total crawl requests      about 1,680
by file type              HTML 80 %   JavaScript 2 %   image 4 %
by Googlebot type         smartphone 57 %   page resource load 4 %
crawled - currently not indexed         411
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here Google fetched far more HTML, because it was not allowed to fetch anything else. It read 411 pages and declined to index them. I cannot prove the blocked resources are the reason: this site also had a week in September when a redirect loop hit every crawler, and it has few links. But a page whose CSS and JS cannot be loaded is not the page a visitor sees, and Google's own guidance is not to block them. I removed the line today.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I take from the two together
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The same complaint, "Google does not index my site", had two different shapes: never crawled on one site, crawled and declined on the other. The Pages report tells you which one you have, and the fix is different.&lt;/li&gt;
&lt;li&gt;Blocking &lt;code&gt;/_next/&lt;/code&gt; does not save crawl budget in any useful way. It trades rendering for raw HTML fetches.&lt;/li&gt;
&lt;li&gt;Allowing it has a cost on a site with little authority: the rendering requests come out of the same small allowance. My guess, and it is only a guess, is that a deploy makes it worse, because the chunk file names change and Google has to fetch them again.&lt;/li&gt;
&lt;li&gt;Crawl stats sit under Settings, not in the main reports, and I had never opened them. Ten minutes there replaced weeks of theories.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What is left for site one is the unglamorous part: links from outside, since the allowance seems to follow how much the rest of the web points at you.&lt;/p&gt;

&lt;p&gt;The calculator site is &lt;a href="https://allsmartcalculators.com/" rel="noopener noreferrer"&gt;AllSmartCalculators&lt;/a&gt;; a typical page is the &lt;a href="https://allsmartcalculators.com/finance/ppf-calculator" rel="noopener noreferrer"&gt;PPF calculator&lt;/a&gt;. Written by an AI assistant from my own Search Console data.&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>seo</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>My PDF parser failed on the first two calls of every fresh process. My error dashboard showed zero.</title>
      <dc:creator>Ankit Gupta</dc:creator>
      <pubDate>Sat, 14 Nov 2026 06:39:15 +0000</pubDate>
      <link>https://dev.to/ankit_gupta_37c6b9df66fb7/my-pdf-parser-failed-on-the-first-two-calls-of-every-fresh-process-my-error-dashboard-showed-zero-38o5</link>
      <guid>https://dev.to/ankit_gupta_37c6b9df66fb7/my-pdf-parser-failed-on-the-first-two-calls-of-every-fresh-process-my-error-dashboard-showed-zero-38o5</guid>
      <description>&lt;p&gt;I run a resume builder for Indian job seekers. The first thing a new account does is upload the resume it already has. Last month 21 people signed up, 9 saved a resume, and none came back a second day. My usage table showed no failed call in two weeks, so I assumed uploads were fine. They were not.&lt;/p&gt;

&lt;h2&gt;
  
  
  The symptom
&lt;/h2&gt;

&lt;p&gt;I made a throwaway account and uploaded a small text PDF. The toast said "We couldn't read that file". I uploaded the same file again and it worked. Same bytes, different answer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reproducing it outside the app
&lt;/h2&gt;

&lt;p&gt;The upload route uses &lt;code&gt;pdf-parse&lt;/code&gt;, which bundles pdf.js v1.10.100 from 2018. I took the route out of the picture and called the library 80 times in a row on the same 2.4 KB file, printing &lt;code&gt;X&lt;/code&gt; for a throw and &lt;code&gt;.&lt;/code&gt; for a result:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight brainfuck"&gt;&lt;code&gt;&lt;span class="no"&gt;XX&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="p"&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="p"&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="p"&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="p"&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="p"&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="p"&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="p"&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="p"&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="p"&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="p"&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="p"&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="p"&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="p"&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="p"&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="p"&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="p"&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="p"&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="p"&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="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;The first two calls throw &lt;code&gt;bad XRef entry&lt;/code&gt;. Every call after that succeeds. Six fresh processes gave the same picture, whether the first call came 0 ms or 1.5 s after the module loaded, so it is a count, not a timer. The file is not broken: it was written by ReportLab, and its &lt;code&gt;startxref&lt;/code&gt; points exactly at the xref table. A PDF produced by my own templates never failed.&lt;/p&gt;

&lt;p&gt;On a laptop that is a curiosity. On serverless it is the normal case: a cold function is a fresh process, so a person whose upload lands on one gets the failure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why nothing showed it
&lt;/h2&gt;

&lt;p&gt;Simplified, the route did this:&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;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;text&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;extractText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;type&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="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&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="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"We couldn't read that file."&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;400&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="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;parsed&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;parseResumeText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// the first logged call&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Only model calls were written to the usage table, and the failure happens one line before the first of them. "Zero errors" was true and meant nothing. Three of those 21 accounts had a resume parsed and never got one saved, and I cannot tell how many never got that far.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I changed
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Retry the local parser. In a plain Node process the third call works, so four tries cover it.&lt;/li&gt;
&lt;li&gt;When it still fails, hand the file itself to a model that reads PDFs and images and ask for a plain transcription. That also covers scans and photos of a resume, which have no text layer at all and had always ended in the same error.&lt;/li&gt;
&lt;li&gt;Log every such read with its reason (&lt;code&gt;pdf_unreadable: bad XRef entry&lt;/code&gt;, &lt;code&gt;pdf_no_text_layer&lt;/code&gt;, &lt;code&gt;image&lt;/code&gt;), success or not.&lt;/li&gt;
&lt;li&gt;Detect the type from the first bytes. Phones hand over PDFs as &lt;code&gt;application/octet-stream&lt;/code&gt; or with no type, and those were being rejected as unsupported.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Then I checked production, and step 1 turned out to be worth less than I thought. On the deployed function the same file failed all four tries and was read by the fallback in two seconds. The retry that fixes a local process does not fix a serverless one, and I only know that because step 3 wrote a row saying so. Eight fallback reads cost about a third of a cent in total by my own price table.&lt;/p&gt;

&lt;p&gt;One place does not get the fallback: the ATS checker. Its job is to report what a parser finds in the file, and for a scan the true answer is "nothing". Transcribing the picture there would turn that finding into a pass.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I took from it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A dashboard that only counts the calls you log shows zero errors for everything that fails before them. Log the step in front of the first "real" call.&lt;/li&gt;
&lt;li&gt;Test a parser in a fresh process, not in a warm REPL or a test runner that has already called it.&lt;/li&gt;
&lt;li&gt;A fix measured locally is a guess until production writes down what it did.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The site is &lt;a href="https://resumebanao.app/" rel="noopener noreferrer"&gt;ResumeBanao&lt;/a&gt;, a resume builder for India; the same upload sits behind the &lt;a href="https://resumebanao.app/ats-check" rel="noopener noreferrer"&gt;free ATS checker&lt;/a&gt;. Written by an AI assistant from my own build notes and usage logs.&lt;/p&gt;

</description>
      <category>node</category>
      <category>webdev</category>
      <category>debugging</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Three front-end bugs my build said were fine</title>
      <dc:creator>Ankit Gupta</dc:creator>
      <pubDate>Sun, 08 Nov 2026 06:03:55 +0000</pubDate>
      <link>https://dev.to/ankit_gupta_37c6b9df66fb7/three-front-end-bugs-my-build-said-were-fine-52pl</link>
      <guid>https://dev.to/ankit_gupta_37c6b9df66fb7/three-front-end-bugs-my-build-said-were-fine-52pl</guid>
      <description>&lt;p&gt;I run a static browser-games site. Every page exists twice: once as prerendered HTML for search engines, and once as a React app for people clicking around. The build is a babel bundle plus a generator script. Here are three bugs that went through that build without a single error and broke the page people actually saw.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. &lt;code&gt;&amp;lt;img width="700" height="700"&amp;gt;&lt;/code&gt; means &lt;code&gt;height: 700px&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Every game card has an image with &lt;code&gt;width&lt;/code&gt; and &lt;code&gt;height&lt;/code&gt; attributes. That is the standard advice: the browser reserves the right space before the image loads, so the layout does not jump.&lt;/p&gt;

&lt;p&gt;My CSS made the image fill its card and kept it square:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.grid&lt;/span&gt; &lt;span class="nt"&gt;img&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;.cards&lt;/span&gt; &lt;span class="nt"&gt;img&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;aspect-ratio&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;object-fit&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;cover&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;block&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;The cards were about 176 px wide, so I expected 176 × 176.&lt;/p&gt;

&lt;p&gt;The browser drew 176 × 700 on every category, tag and collection page. Everything below the first row was pushed off the screen.&lt;/p&gt;

&lt;p&gt;The reason: the &lt;code&gt;height&lt;/code&gt; attribute is not just a hint for the aspect ratio. It maps to a CSS &lt;code&gt;height: 700px&lt;/code&gt;, and &lt;code&gt;aspect-ratio&lt;/code&gt; only takes effect while &lt;code&gt;height&lt;/code&gt; is &lt;code&gt;auto&lt;/code&gt;. My rule set the width and said nothing about the height, so the attribute won.&lt;/p&gt;

&lt;p&gt;The fix is two words in the same rule:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.grid&lt;/span&gt; &lt;span class="nt"&gt;img&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;.cards&lt;/span&gt; &lt;span class="nt"&gt;img&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;auto&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;aspect-ratio&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;object-fit&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;cover&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;block&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;Keep the attributes, because they still prevent layout shift. Just never set a width on an image without also saying &lt;code&gt;height: auto&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Two class names for one grid
&lt;/h2&gt;

&lt;p&gt;The generator that writes the static pages had grown in pieces. Some templates wrote &lt;code&gt;&amp;lt;ul class="grid"&amp;gt;&lt;/code&gt;, others &lt;code&gt;&amp;lt;ul class="cards"&amp;gt;&lt;/code&gt;. Only &lt;code&gt;.grid&lt;/code&gt; had styles.&lt;/p&gt;

&lt;p&gt;Every &lt;code&gt;.cards&lt;/code&gt; list rendered as one full-width thumbnail per row. That included the "related games" strip at the bottom of every game page, which nobody looked at closely because it was at the bottom.&lt;/p&gt;

&lt;p&gt;Nothing failed. The HTML was valid, the CSS was valid, and the pages returned 200. The fix was to style both names together:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.grid&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;.cards&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;list-style&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;grid&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;grid-template-columns&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;repeat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;auto-fill&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;minmax&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;158px&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;1fr&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt; &lt;span class="nl"&gt;gap&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;16px&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;Better still is one class name everywhere, but until then, anything shaped like a grid gets both selectors.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Deleting a feature deleted a neighbour
&lt;/h2&gt;

&lt;p&gt;I removed an ad integration from one large component file. The change was one hunk of about 240 lines. It ran a little past the end of the ad code and also deleted the &lt;code&gt;Logo&lt;/code&gt; component that sat right below it.&lt;/p&gt;

&lt;p&gt;The bundle compiled. Babel transforms syntax; it does not know whether a name you use is defined anywhere. The prerendered pages have no React in them, so they looked perfect.&lt;/p&gt;

&lt;p&gt;The React app threw &lt;code&gt;ReferenceError: Logo is not defined&lt;/code&gt; on load. For a day the homepage showed only its no-JavaScript fallback: a list of popular games with no header, no search, no navigation and no footer. From a distance it looked like a page, which is why it survived a quick look.&lt;/p&gt;

&lt;p&gt;Two checks catch this now:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;After deleting code, compare the top-level definitions before and after:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git show HEAD~1:components.jsx | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-oE&lt;/span&gt; &lt;span class="s2"&gt;"^(function|const|let) +&lt;/span&gt;&lt;span class="se"&gt;\w&lt;/span&gt;&lt;span class="s2"&gt;+"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; before.txt
&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-oE&lt;/span&gt; &lt;span class="s2"&gt;"^(function|const|let) +&lt;/span&gt;&lt;span class="se"&gt;\w&lt;/span&gt;&lt;span class="s2"&gt;+"&lt;/span&gt; components.jsx &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; after.txt
diff before.txt after.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Anything in the diff that you did not mean to remove is the bug.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Load the page in a real browser with a listener on &lt;code&gt;pageerror&lt;/code&gt;. A static check cannot tell you that a name is missing at run time; the browser can, in one line of output.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What the three have in common
&lt;/h2&gt;

&lt;p&gt;Each bug produced valid output. The build, the validator and the HTTP status code all agreed things were fine. What caught them was looking at the rendered page: a screenshot at phone and desktop width, and the browser's error log.&lt;/p&gt;

&lt;p&gt;That is now the last step before anything ships on &lt;a href="https://360playzone.com/" rel="noopener noreferrer"&gt;360 PlayZone&lt;/a&gt;: screenshot a few pages both ways, including the &lt;a href="https://360playzone.com/games/" rel="noopener noreferrer"&gt;full games list&lt;/a&gt;, and read the console.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Written by an AI assistant from my own build notes.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>css</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>debugging</category>
    </item>
    <item>
      <title>My Cloudflare Pages contact form could not send email, and nothing on the page ever said so</title>
      <dc:creator>Ankit Gupta</dc:creator>
      <pubDate>Sat, 07 Nov 2026 11:50:33 +0000</pubDate>
      <link>https://dev.to/ankit_gupta_37c6b9df66fb7/my-cloudflare-pages-contact-form-could-not-send-email-and-nothing-on-the-page-ever-said-so-234o</link>
      <guid>https://dev.to/ankit_gupta_37c6b9df66fb7/my-cloudflare-pages-contact-form-could-not-send-email-and-nothing-on-the-page-ever-said-so-234o</guid>
      <description>&lt;p&gt;I run a small static site on Cloudflare Pages. Its contact page had a plain HTML form that posted to a Pages Function. This week I checked whether that form actually worked. It did not, and nothing a visitor could see would have told me why.&lt;/p&gt;

&lt;h2&gt;
  
  
  How the form was built
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;functions/api/contact.js&lt;/code&gt; reads the POST body, validates the email address and the message length, and sends the message through Brevo’s transactional email API. Whatever happens, it answers with a &lt;code&gt;303&lt;/code&gt; redirect back to the contact page and carries the result in the query string: &lt;code&gt;?sent=ok&lt;/code&gt;, or &lt;code&gt;?sent=error&amp;amp;why=&amp;lt;reason&amp;gt;&lt;/code&gt;. The page reads that and shows a short status line.&lt;/p&gt;

&lt;p&gt;The send step starts like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&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;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;BREVO_API_KEY&lt;/span&gt;&lt;span class="p"&gt;)&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;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;contact: BREVO_API_KEY is not set on this Pages project&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;back&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="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;error&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;config&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;That branch is reasonable. The trouble is what happens to the error: the log line sits in Cloudflare’s function logs, and the visitor sees “The form is not finished being set up.”&lt;/p&gt;

&lt;h2&gt;
  
  
  How I found out
&lt;/h2&gt;

&lt;p&gt;I sent one request with a valid email address and a short message. If the key had existed, that would have delivered a single test email to my own inbox, which I was fine with.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; /dev/null &lt;span class="nt"&gt;-D&lt;/span&gt; - &lt;span class="nt"&gt;-X&lt;/span&gt; POST https://360playzone.com/api/contact &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--data-urlencode&lt;/span&gt; &lt;span class="s2"&gt;"name=Form check"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--data-urlencode&lt;/span&gt; &lt;span class="s2"&gt;"email=formcheck@example.com"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--data-urlencode&lt;/span&gt; &lt;span class="s2"&gt;"message=Automated form check, please ignore this message."&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--data-urlencode&lt;/span&gt; &lt;span class="s2"&gt;"website="&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The empty &lt;code&gt;website&lt;/code&gt; field is the form’s honeypot. The response headers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="k"&gt;HTTP&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="m"&gt;1.1&lt;/span&gt; &lt;span class="m"&gt;303&lt;/span&gt; &lt;span class="ne"&gt;See Other&lt;/span&gt;
&lt;span class="na"&gt;Location&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;https://360playzone.com/page/contact?sent=error&amp;amp;why=config#contact-form&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then I asked Cloudflare which secrets the project has:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx wrangler pages secret list &lt;span class="nt"&gt;--project-name&lt;/span&gt; &amp;lt;project&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It printed the header line for the production environment and then nothing: no secrets at all. I also looked up the DNS records Brevo asks you to add for a sending domain (&lt;code&gt;brevo1._domainkey&lt;/code&gt;, &lt;code&gt;brevo2._domainkey&lt;/code&gt; and a DMARC record). None of them existed. So even with a key, mail from the form’s sender address would not have been authenticated.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why nothing flagged it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Redirect-after-POST makes the failure path and the success path look the same: both are a &lt;code&gt;303&lt;/code&gt;. A check that only asks whether the endpoint answered without a 5xx calls it healthy.&lt;/li&gt;
&lt;li&gt;The error text is written for visitors, not for the person who runs the site.&lt;/li&gt;
&lt;li&gt;A secret that was never added to the production environment looks exactly like a working setup from the outside. I do not know how many visitors hit the error.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I changed
&lt;/h2&gt;

&lt;p&gt;A form that fails is worse than no form: a visitor types a message, presses send and gets an apology. I turned the form off behind a constant, put the email address on the page as a &lt;code&gt;mailto:&lt;/code&gt; link, and rewrote the privacy copy that had described “the optional contact form”. The code stays in the repo. Turning it back on means flipping one flag once the key and the DNS records exist.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I would do next time
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;After deploying anything that reads an environment variable, send one request that exercises it and read the status or the &lt;code&gt;Location&lt;/code&gt; header.&lt;/li&gt;
&lt;li&gt;Make the config branch loud: return a &lt;code&gt;503&lt;/code&gt;, or raise an alert, instead of a friendly redirect.&lt;/li&gt;
&lt;li&gt;Add a scheduled check that posts a dummy message and expects &lt;code&gt;sent=ok&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Keep a list of the secrets each function needs next to the function, and compare it with the project’s real list.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The site is &lt;a href="https://360playzone.com/" rel="noopener noreferrer"&gt;360 PlayZone&lt;/a&gt;, a free browser-games site I run. Its &lt;a href="https://360playzone.com/page/contact" rel="noopener noreferrer"&gt;contact page&lt;/a&gt; is email-only until the sending setup is finished.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Written with AI assistance (Claude). Every measurement above comes from commands run against the live site and the Pages project.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>devops</category>
      <category>cloudflare</category>
    </item>
    <item>
      <title>Writing verifiable facts for 118 browser games found 9 bugs in my own code</title>
      <dc:creator>Ankit Gupta</dc:creator>
      <pubDate>Thu, 05 Nov 2026 14:26:53 +0000</pubDate>
      <link>https://dev.to/ankit_gupta_37c6b9df66fb7/writing-verifiable-facts-for-118-browser-games-found-9-bugs-in-my-own-code-jol</link>
      <guid>https://dev.to/ankit_gupta_37c6b9df66fb7/writing-verifiable-facts-for-118-browser-games-found-9-bugs-in-my-own-code-jol</guid>
      <description>&lt;p&gt;I run a free browser-games site with a few hundred HTML5 games, and most of them are originals I wrote or adapted myself. The pages for them were fine: a title, a description, controls, a few paragraphs. They were also forgettable, and nothing on them was something only I could say.&lt;/p&gt;

&lt;p&gt;So I added one section to every game page: &lt;strong&gt;"Inside : what we checked"&lt;/strong&gt;. It holds a method line, two real screenshots, and four to six facts about the game. The rule is strict, and it turned out to be an excellent bug finder.&lt;/p&gt;

&lt;h2&gt;
  
  
  The rule
&lt;/h2&gt;

&lt;p&gt;Every number in a fact has to be in the game's code. If I derive it rather than read it, the sentence says "about". Every screenshot caption describes only what is visible in that frame. And a fact must never advertise a bug: if I cannot write the sentence honestly, I fix the game or drop the sentence.&lt;/p&gt;

&lt;p&gt;That last clause is where the work was. You cannot write "the snake can turn back on itself without dying" and publish it. You go and look at the input handler.&lt;/p&gt;

&lt;h2&gt;
  
  
  What writing the facts found
&lt;/h2&gt;

&lt;p&gt;I did this for 118 games. These are the problems it surfaced, all fixed the same day:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Snake&lt;/strong&gt; let you reverse direction if you pressed two turns quickly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hangman&lt;/strong&gt; and &lt;strong&gt;word scramble&lt;/strong&gt; swallowed the letter M (word scramble also dropped H and N).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Blast Arena&lt;/strong&gt; showed a 60-second clock that did nothing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tangram&lt;/strong&gt;: the twin pieces were not interchangeable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pinball&lt;/strong&gt;: the slingshot scored on every frame it was touched, not once per hit.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;FreeCell&lt;/strong&gt;: the "Played" counter never counted.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Road Cross&lt;/strong&gt;: the game frame was wider than its canvas.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Wreck Arena&lt;/strong&gt; showed a DEMO badge during play.&lt;/li&gt;
&lt;li&gt;Three label typos (checkers, pool blitz, spider solitaire), and the &lt;strong&gt;Asteroids&lt;/strong&gt; description promised a hyperspace button the game does not have.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of these would have shown up in a test suite, because I have none. They showed up because I had to make a specific, checkable claim and then check it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this works better than "write good descriptions"
&lt;/h2&gt;

&lt;p&gt;A vague description can never be wrong, so nobody checks it. A sentence like "the clock runs for 60 seconds" is falsifiable, so you open the game and watch the clock. Forcing the copy to be checkable made the copy an audit.&lt;/p&gt;

&lt;p&gt;It also gives the page something a template cannot: a sentence that is true of this game and no other.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I would do again
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Make claims that can be wrong, then check them against the code, not against memory.&lt;/li&gt;
&lt;li&gt;Say "about" for derived numbers.&lt;/li&gt;
&lt;li&gt;Treat a fact you cannot honestly publish as a bug report.&lt;/li&gt;
&lt;li&gt;Keep screenshots to what is visible; do not caption what you remember.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The pages are on &lt;a href="https://360playzone.com/" rel="noopener noreferrer"&gt;360 PlayZone&lt;/a&gt;. If you want to see what a checked page looks like, &lt;a href="https://360playzone.com/play/snake-arena" rel="noopener noreferrer"&gt;Snake Arena&lt;/a&gt; and &lt;a href="https://360playzone.com/play/hangman" rel="noopener noreferrer"&gt;Hangman&lt;/a&gt; are two of them.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Written by an AI assistant from my own repo notes and commit history.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>testing</category>
      <category>webdev</category>
      <category>gamedev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>My auth middleware sent Googlebot into a redirect loop. My health checks said 200.</title>
      <dc:creator>Ankit Gupta</dc:creator>
      <pubDate>Tue, 03 Nov 2026 13:28:30 +0000</pubDate>
      <link>https://dev.to/ankit_gupta_37c6b9df66fb7/my-auth-middleware-sent-googlebot-into-a-redirect-loop-my-health-checks-said-200-2be5</link>
      <guid>https://dev.to/ankit_gupta_37c6b9df66fb7/my-auth-middleware-sent-googlebot-into-a-redirect-loop-my-health-checks-said-200-2be5</guid>
      <description>&lt;p&gt;I run a resume builder for Indian job seekers. In September I moved it to a hosted auth provider, and within a week Google impressions went from about a hundred a day to four. Nothing in my monitoring noticed. Here is what happened, how I found it, and the two checks that would have caught it on day one.&lt;/p&gt;

&lt;h2&gt;
  
  
  The symptom
&lt;/h2&gt;

&lt;p&gt;Search Console, impressions per day, before and after the cutover:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;before   45 to 146 / day
after     4,  3,  5 / day
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every page still showed as "Submitted and indexed", so it did not look like a de-indexing. The brand query, the one people type when they already know the site, went from about 60 a week to roughly zero. Humans could use the site the whole time. Only search traffic died.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the provider's middleware does
&lt;/h2&gt;

&lt;p&gt;The auth middleware runs on every request. When it sees a browser-shaped request with no session cookie, it starts a "handshake": a 307 to the provider's domain, which sets a cookie and sends the browser back with a token in the query string, which the middleware strips with another 307 to the clean URL.&lt;/p&gt;

&lt;p&gt;For a browser that is three redirects, once. The cookie is set, and every request after that is a plain 200.&lt;/p&gt;

&lt;p&gt;A crawler keeps no cookie jar. So for Googlebot the sequence was:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;GET /                       -&amp;gt; 307 to provider /v1/client/handshake
GET provider handshake      -&amp;gt; 307 back to /?__clerk_handshake=...
GET /?__clerk_handshake=... -&amp;gt; 307 to /
GET /                       -&amp;gt; 307 to provider handshake   (and so on)
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every public page, forever. Bing's crawl stats confirmed it from the other side: its "other response codes" count, where 307s land, climbed from 1 a day to 15 in the same week.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why my checks passed
&lt;/h2&gt;

&lt;p&gt;I had three checks on the site, and all three returned 200 while the loop was running.&lt;/p&gt;

&lt;p&gt;The middleware only starts a handshake for requests it considers "document" requests. Its test is: the request is a GET, and either &lt;code&gt;sec-fetch-dest&lt;/code&gt; is &lt;code&gt;document&lt;/code&gt; or &lt;code&gt;iframe&lt;/code&gt;, or there is no &lt;code&gt;sec-fetch-dest&lt;/code&gt; header and &lt;code&gt;Accept&lt;/code&gt; contains &lt;code&gt;text/html&lt;/code&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;My uptime check sent &lt;code&gt;HEAD&lt;/code&gt;. A HEAD is never eligible, so it got 200.&lt;/li&gt;
&lt;li&gt;My scripted check used &lt;code&gt;fetch()&lt;/code&gt; with no headers. The default &lt;code&gt;Accept&lt;/code&gt; is &lt;code&gt;*/*&lt;/code&gt;, which does not contain &lt;code&gt;text/html&lt;/code&gt;, so it got 200.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;curl&lt;/code&gt; with no headers: same default &lt;code&gt;Accept&lt;/code&gt;, same 200.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Googlebot sends &lt;code&gt;Accept: text/html,application/xhtml+xml,...&lt;/code&gt; on a GET, like a browser, and no &lt;code&gt;sec-fetch-dest&lt;/code&gt;. That is the exact shape the middleware treats as a browser without a session.&lt;/p&gt;

&lt;p&gt;So the site was dead for crawlers and alive for every probe I had pointed at it. The checks were not wrong; they were asking a different question.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix
&lt;/h2&gt;

&lt;p&gt;The proper fix is to run on the provider's production instance, where the handshake behaves differently. The fast fix, shipped the same day I found the loop, is a wrapper around the middleware. If the user agent matches a crawler list, the wrapper sets &lt;code&gt;sec-fetch-dest: empty&lt;/code&gt; on the request before the auth middleware sees it. The middleware then answers the request as signed-out, which for a public page is a normal 200 with the real title.&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;CRAWLER&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sr"&gt;/googlebot|bingbot|mediapartners-google|duckduckbot|yandex|applebot/i&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="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;middleware&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;NextRequest&lt;/span&gt;&lt;span class="p"&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;CRAWLER&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&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;user-agent&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;??&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="nx"&gt;req&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;sec-fetch-dest&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;empty&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="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;authMiddleware&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&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;Verified live by fetching as Googlebot, Bingbot and Mediapartners with a browser &lt;code&gt;Accept&lt;/code&gt; header and redirects off: 200 with the page title. &lt;code&gt;/dashboard&lt;/code&gt; still redirects to login. A real Chrome session is unchanged.&lt;/p&gt;

&lt;h2&gt;
  
  
  The two checks I run now
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Fetch as a crawler, the way a crawler does it: a &lt;code&gt;GET&lt;/code&gt;, &lt;code&gt;Accept: text/html,application/xhtml+xml&lt;/code&gt;, a Googlebot user agent, and redirects &lt;strong&gt;off&lt;/strong&gt;. Anything other than 200 with the right title fails the check. Following redirects hides a loop behind a final 200 or a timeout.&lt;/li&gt;
&lt;li&gt;After any change to auth or middleware, run that check before trusting any other green light.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The part that still stings: five weeks later, Google has recrawled only a handful of pages, and daily impressions are still single digits. A week of 307s cost far more than a week.&lt;/p&gt;

&lt;p&gt;The site is &lt;a href="https://resumebanao.app/" rel="noopener noreferrer"&gt;ResumeBanao&lt;/a&gt;, a resume builder for India; the page that lost the most traffic was the &lt;a href="https://resumebanao.app/ats-check" rel="noopener noreferrer"&gt;free ATS checker&lt;/a&gt;. Written by an AI assistant from my own build notes and Search Console data.&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>seo</category>
      <category>webdev</category>
      <category>debugging</category>
    </item>
    <item>
      <title>121 of my 145 page titles were too long. The brand was the part search engines cut.</title>
      <dc:creator>Ankit Gupta</dc:creator>
      <pubDate>Tue, 03 Nov 2026 13:28:10 +0000</pubDate>
      <link>https://dev.to/ankit_gupta_37c6b9df66fb7/121-of-my-145-page-titles-were-too-long-the-brand-was-the-part-search-engines-cut-2ofp</link>
      <guid>https://dev.to/ankit_gupta_37c6b9df66fb7/121-of-my-145-page-titles-were-too-long-the-brand-was-the-part-search-engines-cut-2ofp</guid>
      <description>&lt;p&gt;I run a site of about a hundred free calculators. Every page title was built the same way: the page's own title, then &lt;code&gt;| AllSmartCalculators&lt;/code&gt;. It looked tidy in the code. In the search results it looked like someone else had written my titles.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the numbers said
&lt;/h2&gt;

&lt;p&gt;I pulled every URL from the sitemap and measured the &lt;code&gt;&amp;lt;title&amp;gt;&lt;/code&gt; length:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;145 titles
121 longer than 60 characters
102 longer than 70
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Google and Bing cut a title at roughly 60 characters (it is really a pixel width, so narrow letters buy you a few more). On my pages the brand came last, so the brand was what got cut, which made the suffix pointless. On the longest titles the engines did something worse: they threw the whole title away and wrote their own from the H1 or the page text, so the result title was whatever the engine felt like that day.&lt;/p&gt;

&lt;h2&gt;
  
  
  The rule I replaced it with
&lt;/h2&gt;

&lt;p&gt;The brand already appears in &lt;code&gt;og:site_name&lt;/code&gt;, in the Organization and WebSite structured data and in the breadcrumb. It is not lost when it leaves the &lt;code&gt;&amp;lt;title&amp;gt;&lt;/code&gt;. So the suffix became conditional:&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;BRAND&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;AllSmartCalculators&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;SUFFIX&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;BRAND&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;MAX_TITLE&lt;/span&gt; &lt;span class="o"&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;TRAILING_BRAND&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="se"&gt;\s&lt;/span&gt;&lt;span class="sr"&gt;*&lt;/span&gt;&lt;span class="se"&gt;[&lt;/span&gt;&lt;span class="sr"&gt;|—–-&lt;/span&gt;&lt;span class="se"&gt;]\s&lt;/span&gt;&lt;span class="sr"&gt;*AllSmartCalculators&lt;/span&gt;&lt;span class="se"&gt;\s&lt;/span&gt;&lt;span class="sr"&gt;*$/u&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;seoTitle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;base&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="kr"&gt;string&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;stripped&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;base&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;TRAILING_BRAND&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;trim&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;stripped&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;SUFFIX&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="nx"&gt;MAX_TITLE&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;stripped&lt;/span&gt;&lt;span class="p"&gt;}${&lt;/span&gt;&lt;span class="nx"&gt;SUFFIX&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;stripped&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;Two details matter more than the length check.&lt;/p&gt;

&lt;p&gt;First, the function strips a brand the CMS author already typed. Some titles were long because the content editor had added the brand by hand and the template added it again.&lt;/p&gt;

&lt;p&gt;Second, every metadata generator goes through this one function: calculators, categories, blog posts. Before, each had its own string template, and the blog used an em dash while the calculators used a pipe, so the same site had two brand suffixes.&lt;/p&gt;

&lt;h2&gt;
  
  
  What changed on the page side
&lt;/h2&gt;

&lt;p&gt;The function cannot shorten a base title that is already 70 characters. So the real work was in the titles themselves, and that was a writing job, not a code job:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Lead with the term people search, then the qualifier: "EMI Calculator: Free Home, Car &amp;amp; Personal Loan EMI Tool".&lt;/li&gt;
&lt;li&gt;One idea per title. The compound interest post went from "Compound Interest Formula: Monthly, Quarterly, Annual" to "Compound Interest Formula with Examples (Monthly, Yearly)", because "compound interest formula" and "formula example" are the queries the page is actually shown for in Bing's query report.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How to check your own site in a minute
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// in the browser console on any page&lt;/span&gt;
&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For the whole site, fetch each sitemap URL and read the title tag. If more than a handful are over 60, the brand suffix is probably the first thing to make conditional, and the titles themselves are the second.&lt;/p&gt;

&lt;p&gt;The site is &lt;a href="https://allsmartcalculators.com/" rel="noopener noreferrer"&gt;AllSmartCalculators&lt;/a&gt;; the post that got the biggest title rewrite is the &lt;a href="https://allsmartcalculators.com/blog/compound-interest-formula-examples" rel="noopener noreferrer"&gt;compound interest formula with examples&lt;/a&gt;. Written by an AI assistant from my own build notes and the measured title lengths.&lt;/p&gt;

</description>
      <category>seo</category>
      <category>programming</category>
    </item>
    <item>
      <title>I pointed a canonical at the real page. Google indexed the 1 KB stub instead.</title>
      <dc:creator>Ankit Gupta</dc:creator>
      <pubDate>Fri, 30 Oct 2026 15:57:09 +0000</pubDate>
      <link>https://dev.to/ankit_gupta_37c6b9df66fb7/i-pointed-a-canonical-at-the-real-page-google-indexed-the-1-kb-stub-instead-505j</link>
      <guid>https://dev.to/ankit_gupta_37c6b9df66fb7/i-pointed-a-canonical-at-the-real-page-google-indexed-the-1-kb-stub-instead-505j</guid>
      <description>&lt;p&gt;I run a static browser-games site. Every game has two URLs: &lt;code&gt;/play/&amp;lt;slug&amp;gt;&lt;/code&gt;, a full page with the game, a description and instructions, and &lt;code&gt;/game/&amp;lt;slug&amp;gt;&lt;/code&gt;, a bare player that other sites can put in an iframe. I wanted Google to index the first and ignore the second. It took three attempts, and the one I was most sure about is the one that failed.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it started: the SPA fallback
&lt;/h2&gt;

&lt;p&gt;At first &lt;code&gt;/game/&amp;lt;slug&amp;gt;&lt;/code&gt; had no file behind it. Cloudflare Pages answers any unmatched path with &lt;code&gt;index.html&lt;/code&gt; when a project has no &lt;code&gt;404.html&lt;/code&gt;, so a crawler fetching &lt;code&gt;/game/battleship&lt;/code&gt; received the homepage's title, a canonical pointing at &lt;code&gt;/&lt;/code&gt;, and &lt;code&gt;index, follow&lt;/code&gt;. My JavaScript rewrote all three after the app loaded.&lt;/p&gt;

&lt;p&gt;The raw HTML and the rendered page disagreed, and Google settled it in its own favour. URL Inspection in Search Console said:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/game/battleship   Submitted and indexed
                   Google-selected canonical:  /game/battleship
                   User-declared canonical:    /play/battleship   &amp;lt;- ignored
/play/battleship   URL is unknown to Google
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The empty shell was indexed. The 988-word page was invisible.&lt;/p&gt;

&lt;p&gt;The same fallback did something worse. A URL under a language prefix that existed in no form at all drew 93 impressions at an average position of 8.8, because the fallback returned 200 for it too.&lt;/p&gt;

&lt;h2&gt;
  
  
  Attempt 1: a real file with noindex
&lt;/h2&gt;

&lt;p&gt;I made &lt;code&gt;/game/&amp;lt;slug&amp;gt;&lt;/code&gt; a real file of about 1.1 KB: the iframe, an attribution link, and &lt;code&gt;noindex, follow&lt;/code&gt;. Because every URL that needed the fallback now had a file, I could ship a real &lt;code&gt;404.html&lt;/code&gt;, and unmatched paths finally returned 404.&lt;/p&gt;

&lt;p&gt;Then I talked myself out of the &lt;code&gt;noindex&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Attempt 2: canonical instead of noindex
&lt;/h2&gt;

&lt;p&gt;The argument was a good one. &lt;code&gt;noindex&lt;/code&gt; throws away whatever ranking a URL has earned, while a canonical moves it to the target. And these URLs had earned some: over eleven days, 48 different &lt;code&gt;/game/&lt;/code&gt; URLs drew impressions. Battleship had 68 impressions at around position 32, with 5 clicks.&lt;/p&gt;

&lt;p&gt;So I swapped &lt;code&gt;noindex&lt;/code&gt; for a canonical pointing at &lt;code&gt;/play/&amp;lt;slug&amp;gt;&lt;/code&gt;. Nothing else about the stub was wrong: the canonical was correct, the URL was in no sitemap, and no internal link pointed at it.&lt;/p&gt;

&lt;p&gt;Google recrawled the stub the next day. Search Console, the day after that:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/game/battleship   Submitted and indexed
                   Google-selected canonical:  /game/battleship   &amp;lt;- kept the stub
                   User-declared canonical:    /play/battleship   &amp;lt;- declared, ignored
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both URLs were now in the index, competing with each other. That was the exact situation I had set out to end.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why it failed
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;rel=canonical&lt;/code&gt; is a hint, and Google follows it between pages it considers duplicates of each other. A 1.1 KB page holding an iframe is nothing like a 988-word page about the same game. They share a subject, not content. So the hint was discarded.&lt;/p&gt;

&lt;p&gt;That changes what the choice had been. I thought I was choosing between discarding the signal and forwarding it. The forwarding was never going to happen.&lt;/p&gt;

&lt;h2&gt;
  
  
  Attempt 3: noindex again, canonical removed
&lt;/h2&gt;

&lt;p&gt;I put &lt;code&gt;noindex, follow&lt;/code&gt; back and deleted the canonical instead of leaving the two side by side. A &lt;code&gt;noindex&lt;/code&gt; next to a canonical that points somewhere else are two instructions that contradict each other, and the risk usually described is the &lt;code&gt;noindex&lt;/code&gt; being applied to the canonical target. Here the target is the page I need indexed.&lt;/p&gt;

&lt;p&gt;Sites that embed the player are not affected. An iframe requests the file and never reads a canonical.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I would tell myself earlier
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Read "Google-selected canonical" in URL Inspection. The canonical you declared is only a request.&lt;/li&gt;
&lt;li&gt;Do not fix title, canonical and robots in JavaScript on a fallback page. The raw HTML and the rendered page will disagree, and you do not choose which one Google believes.&lt;/li&gt;
&lt;li&gt;A canonical between two pages that are not near-duplicates can be ignored. Mine was. Use &lt;code&gt;noindex&lt;/code&gt;, or a redirect if nothing needs the URL.&lt;/li&gt;
&lt;li&gt;Do not combine &lt;code&gt;noindex&lt;/code&gt; with a canonical to a different URL.&lt;/li&gt;
&lt;li&gt;Make unmatched URLs return 404. A fallback that answers 200 for everything will get URLs indexed that you never created.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The pages in this story are on &lt;a href="https://360playzone.com/" rel="noopener noreferrer"&gt;360 PlayZone&lt;/a&gt;, and the example is its &lt;a href="https://360playzone.com/play/battleship" rel="noopener noreferrer"&gt;Battleship page&lt;/a&gt;. If you have watched Google accept a canonical between two pages this different, I would like to hear how.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Written by an AI assistant from my own build notes and Search Console data.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>google</category>
      <category>javascript</category>
      <category>seo</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Two Cloudflare Pages behaviours I had to measure to believe</title>
      <dc:creator>Ankit Gupta</dc:creator>
      <pubDate>Thu, 17 Sep 2026 05:16:02 +0000</pubDate>
      <link>https://dev.to/ankit_gupta_37c6b9df66fb7/two-cloudflare-pages-behaviours-i-had-to-measure-to-believe-4gki</link>
      <guid>https://dev.to/ankit_gupta_37c6b9df66fb7/two-cloudflare-pages-behaviours-i-had-to-measure-to-believe-4gki</guid>
      <description>&lt;p&gt;I run a static browser-games site on Cloudflare Pages: about 4,700 prerendered HTML files, a small React shell, no server. Two things cost me days because the platform did not fail loudly. Both are easy to reproduce, so here are the measurements rather than opinions.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Cache-Control in _headers is ignored for static assets
&lt;/h2&gt;

&lt;p&gt;The symptom: after a deploy, one page said the catalogue had 211 games while another route, in the same browser at the same moment, said 191. The prerendered HTML was new. The JavaScript data file the app shell reads was four hours old.&lt;/p&gt;

&lt;p&gt;So I added the obvious rule:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;/data.js
  Cache-Control: public, max-age=0, must-revalidate
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Deployed it, fetched the file, and the response still said:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;cache-control: public, max-age=14400, must-revalidate
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The interesting part is that _headers itself was clearly being applied. My catch-all rule sets X-Content-Type-Options, and that header was on the very same response. So the file is read, the path matches, and this one header is overridden for static assets. HTML is the exception: Pages already serves it with max-age=0, must-revalidate.&lt;/p&gt;

&lt;p&gt;The fix that the platform cannot override is the old one: put a content hash in the URL. My build now hashes data.js, the compiled bundle and the stylesheet and writes them into index.html as &lt;code&gt;?v=&amp;lt;hash&amp;gt;&lt;/code&gt;. One ordering trap: the hashing step has to run after the bundler, otherwise you hash the previous build's bundle and ship a URL that points at stale content with a fresh-looking version.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. _redirects silently stops at about 100 rules
&lt;/h2&gt;

&lt;p&gt;The docs give a budget of 2,000 static and 100 dynamic redirects. In production, every rule after roughly the 104th line in my file did nothing. No build error, no warning, the rule just never fired.&lt;/p&gt;

&lt;p&gt;I first suspected a size limit, so I cut the file from 15.3 KB to 6.4 KB by deleting comments and merging rules. The boundary stayed at the same rule. That makes it a count cap, not a byte cap, at least for a file that mixes static and splat rules the way mine does.&lt;/p&gt;

&lt;p&gt;What I do now:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Practice&lt;/th&gt;
&lt;th&gt;Why&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Keep the file under 100 rules&lt;/td&gt;
&lt;td&gt;Everything past the cap is silently dead&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Order by importance: load-bearing 301s first, nice-to-haves last&lt;/td&gt;
&lt;td&gt;If the cap bites, it bites the rules that matter least&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Make the last rule a canary&lt;/td&gt;
&lt;td&gt;One curl -sI after each deploy tells me whether the whole file is live&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The canary is the cheapest monitoring I have. If the last rule answers 301, every rule above it is inside the cap.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bonus: a deleted page keeps answering 200 for up to a week
&lt;/h2&gt;

&lt;p&gt;After I removed about 1,100 pages, a plain request to one of the deleted URLs still returned 200 with the old body and Cache-Control: public, s-maxage=604800, a seven-day shared cache. The same URL with a throwaway query string ?cb=8471) returned 404 in the same second, because the query string changes the cache key and misses the stale entry.&lt;/p&gt;

&lt;p&gt;So when you delete pages on Pages, verify with a cache-buster. A plain request shows you the corpse and you will think the deploy failed. It drains on its own; a cache purge is the only way to hurry it.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I test now
&lt;/h2&gt;

&lt;p&gt;There is no test suite for a static site like this, so I serve the build output locally the way Cloudflare does (the file if it exists, otherwise 404.html with a real 404) and sweep it with Playwright, with redirects disabled. Following redirects reports the final 200 and hides broken sitemap entries and wrong canonicals.&lt;/p&gt;

&lt;p&gt;The site these measurements come from is &lt;a href="https://360playzone.com/" rel="noopener noreferrer"&gt;360 PlayZone&lt;/a&gt;, a free browser-games portal. If you have seen the rule cap land somewhere other than ~100, I would like to compare notes. I measured mine on &lt;a href="https://360playzone.com/" rel="noopener noreferrer"&gt;360playzone.com&lt;/a&gt; in August 2026 and it has not moved since.&lt;/p&gt;

</description>
      <category>cloudflare</category>
      <category>webdev</category>
      <category>devops</category>
      <category>seo</category>
    </item>
  </channel>
</rss>
