<?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: Alexei</title>
    <description>The latest articles on DEV Community by Alexei (@alexeilev).</description>
    <link>https://dev.to/alexeilev</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%2F4188632%2F1f4192b6-3283-4d0f-959e-9b09ea5b2091.png</url>
      <title>DEV Community: Alexei</title>
      <link>https://dev.to/alexeilev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alexeilev"/>
    <language>en</language>
    <item>
      <title>Spelling out money in Russian, Ukrainian and Lithuanian: the number is the easy part</title>
      <dc:creator>Alexei</dc:creator>
      <pubDate>Fri, 20 Nov 2026 13:50:16 +0000</pubDate>
      <link>https://dev.to/alexeilev/spelling-out-money-in-russian-ukrainian-and-lithuanian-the-number-is-the-easy-part-30jm</link>
      <guid>https://dev.to/alexeilev/spelling-out-money-in-russian-ukrainian-and-lithuanian-the-number-is-the-easy-part-30jm</guid>
      <description>&lt;p&gt;In Russia, Ukraine, Kazakhstan and Lithuania an invoice or a contract usually states the amount twice: in digits and in words. "1 521.40 RUB" becomes "Одна тысяча пятьсот двадцать один рубль 40 копеек".&lt;/p&gt;

&lt;p&gt;I needed this in five languages and assumed it was a solved problem. Turning a number into words is solved, num2words does it well. What breaks is the currency name next to the number.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three plural forms, not two
&lt;/h2&gt;

&lt;p&gt;English has "1 dollar" and "2 dollars". Russian has three forms, and which one you get depends on the last digits:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Amount&lt;/th&gt;
&lt;th&gt;Russian&lt;/th&gt;
&lt;th&gt;Ukrainian&lt;/th&gt;
&lt;th&gt;Lithuanian&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;один рубль&lt;/td&gt;
&lt;td&gt;одна гривня&lt;/td&gt;
&lt;td&gt;vienas euras&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;два рубля&lt;/td&gt;
&lt;td&gt;дві гривні&lt;/td&gt;
&lt;td&gt;du eurai&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;пять рублей&lt;/td&gt;
&lt;td&gt;п'ять гривень&lt;/td&gt;
&lt;td&gt;penki eurai&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;11&lt;/td&gt;
&lt;td&gt;одиннадцать рублей&lt;/td&gt;
&lt;td&gt;одинадцять гривень&lt;/td&gt;
&lt;td&gt;vienuolika eurų&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;21&lt;/td&gt;
&lt;td&gt;двадцать один рубль&lt;/td&gt;
&lt;td&gt;двадцять одна гривня&lt;/td&gt;
&lt;td&gt;dvidešimt vienas euras&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The rule for Russian and Ukrainian:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;plural_index&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&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="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;          &lt;span class="c1"&gt;# рубль&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;14&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;          &lt;span class="c1"&gt;# рубля&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;              &lt;span class="c1"&gt;# рублей&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lithuanian looks similar but splits differently: everything ending in 0 or in 11 to 19 takes the genitive plural ("dešimt eurų"), so a copy of the Russian rule gives wrong output for 20, 30, 100.&lt;/p&gt;

&lt;h2&gt;
  
  
  Gender changes the number itself
&lt;/h2&gt;

&lt;p&gt;The currency also decides the form of "one" and "two". Hryvnia is feminine, so it is "одна гривня", "дві гривні". Euro in Ukrainian is neuter: "одне євро". Lithuanian does the same with "du eurai" but "dvi grivinos". And "тысяча" (thousand) is itself feminine in Russian, so 2 000 is "две тысячи" even when the currency is masculine.&lt;/p&gt;

&lt;p&gt;Some currencies ignore all of this. Tenge and euro do not change in Russian at all ("пять тенге"), but the minor unit does ("пять тиынов").&lt;/p&gt;

&lt;h2&gt;
  
  
  French has its own traps
&lt;/h2&gt;

&lt;p&gt;"Quatre-vingts euros" takes an s, "quatre-vingt-un euros" does not. "Deux cents euros" takes an s, "deux cent mille euros" does not. And a round million is a noun, so it is "un million d'euros", but "un million deux euros".&lt;/p&gt;

&lt;h2&gt;
  
  
  Who actually needs this
&lt;/h2&gt;

&lt;p&gt;The online version of this converter on my site gets most of its Google impressions from Kazakhstan: 223 of 974. People search for things like "тенге прописью", which is exactly the case where the main unit does not decline and the minor one does.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I checked it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Plain number words in all five languages match num2words on 8 000 values: 0 to 3 000 plus 5 000 random numbers up to 10^14.&lt;/li&gt;
&lt;li&gt;The Rust port gives the same output as the Python version on 20 000 random amounts across all currencies, languages and formats. Zero mismatches.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Use it
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip install summa-propisyu
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;summa_propisyu&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;amount_in_words&lt;/span&gt;
&lt;span class="nf"&gt;amount_in_words&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;22.02&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"UAH"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lang&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"uk"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;# 'Двадцять дві гривні 02 копійки'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Rust: &lt;code&gt;cargo add summa-propisyu&lt;/code&gt;, docs on &lt;a href="https://docs.rs/summa-propisyu" rel="noopener noreferrer"&gt;docs.rs&lt;/a&gt;. Without code: &lt;a href="https://www.utilixi.com/ru/converter/number-to-words" rel="noopener noreferrer"&gt;сумма прописью online&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Eight currencies for now: EUR, USD, GBP, PLN, UAH, RUB, BYN, KZT.&lt;/p&gt;

&lt;p&gt;One question for Lithuanian speakers: on an invoice, does "vienas tūkstantis eurų" look right to you, or would you write just "tūkstantis eurų"? I went with the first because that is what num2words and bank forms use, but I am not sure it is what people expect.&lt;/p&gt;

</description>
      <category>python</category>
      <category>rust</category>
      <category>i18n</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Bots, not users, used 83% of my Vercel ISR quota in a month</title>
      <dc:creator>Alexei</dc:creator>
      <pubDate>Fri, 16 Oct 2026 10:48:48 +0000</pubDate>
      <link>https://dev.to/alexeilev/bots-not-users-used-83-of-my-vercel-isr-quota-in-a-month-a3f</link>
      <guid>https://dev.to/alexeilev/bots-not-users-used-83-of-my-vercel-isr-quota-in-a-month-a3f</guid>
      <description>&lt;p&gt;I run a small multilingual tools site on Next.js and Vercel. About 116 calculators and converters, five languages, pages served with ISR. In late September I added programmatic subpages (one page per value, like a page for each military time), and the sitemap grew from 635 to about 1,185 URLs.&lt;/p&gt;

&lt;p&gt;Two weeks later Vercel showed me this on the Hobby plan:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ISR Reads: 768,741 of 1,000,000 for the rolling 30 days (October 3)&lt;/li&gt;
&lt;li&gt;daily reads went from 13 to 16K in early September to 30 to 84K in late September&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Hobby does not bill you for overage. It pauses the feature until the 30-day window frees up. For a site built on ISR that means pages stop being served. So I had about a week.&lt;/p&gt;

&lt;h2&gt;
  
  
  Who was actually reading
&lt;/h2&gt;

&lt;p&gt;Observability keeps 12 hours on Hobby. In those 12 hours there were 15K CDN requests. The top of the bot list:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Bot&lt;/th&gt;
&lt;th&gt;Requests&lt;/th&gt;
&lt;th&gt;Served from cache&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;meta-externalagent&lt;/td&gt;
&lt;td&gt;4,000&lt;/td&gt;
&lt;td&gt;79.9%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;semrush-site-audit&lt;/td&gt;
&lt;td&gt;2,500&lt;/td&gt;
&lt;td&gt;44%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;google-inspectiontool&lt;/td&gt;
&lt;td&gt;429&lt;/td&gt;
&lt;td&gt;85.8%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;bingbot&lt;/td&gt;
&lt;td&gt;259&lt;/td&gt;
&lt;td&gt;77.2%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;googlebot&lt;/td&gt;
&lt;td&gt;95&lt;/td&gt;
&lt;td&gt;63.2%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Googlebot made 95 requests. Meta's crawler made 4,000.&lt;/p&gt;

&lt;p&gt;The routes told the rest of the story. Regular pages had 85 to 97% cache hits. The new programmatic subpages were at 43 to 52%. A crawler walking through hundreds of rarely visited URLs keeps missing the regional CDN cache, and every miss falls back to the durable ISR cache, which is what you pay reads for.&lt;/p&gt;

&lt;p&gt;One more thing I learned from the docs: each deployment gets its own cache. My site redeploys every night to refresh daily content, so every night the cache starts cold and the morning crawlers pay for it.&lt;/p&gt;

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

&lt;p&gt;A single Firewall rule: deny when the user agent contains &lt;code&gt;meta-externalagent&lt;/code&gt;, &lt;code&gt;Bytespider&lt;/code&gt;, &lt;code&gt;CCBot&lt;/code&gt;, &lt;code&gt;PetalBot&lt;/code&gt; or &lt;code&gt;GPTBot&lt;/code&gt;. Search crawlers like Googlebot, Bingbot and OAI-SearchBot are not in it.&lt;/p&gt;

&lt;p&gt;After that, on the programmatic routes:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Route&lt;/th&gt;
&lt;th&gt;Cache hits before&lt;/th&gt;
&lt;th&gt;After&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;numerology pairs&lt;/td&gt;
&lt;td&gt;43%&lt;/td&gt;
&lt;td&gt;77%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;military time values&lt;/td&gt;
&lt;td&gt;52%&lt;/td&gt;
&lt;td&gt;94%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;pet age values&lt;/td&gt;
&lt;td&gt;51%&lt;/td&gt;
&lt;td&gt;69%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Daily reads dropped to 23 to 29K. Better, but still above what the rolling window needed, because there were hourly spikes of 3 to 6K that I could not attribute to anyone within the 12-hour log window.&lt;/p&gt;

&lt;p&gt;Later the Firewall traffic view showed one more source: a single cloud provider network (Tencent, AS132203) sending about 22% of all requests in a day. Blocking by AS number took care of that.&lt;/p&gt;

&lt;p&gt;In the end I moved to Pro anyway. Over a 30-day window the site had 826K ISR reads, while Web Analytics counted about 900 visitors. That ratio is the part I keep thinking about.&lt;/p&gt;

&lt;h2&gt;
  
  
  The question
&lt;/h2&gt;

&lt;p&gt;For those of you running programmatic pages on ISR: how do you keep the long tail cheap when most of the traffic is crawlers? Would you generate these pages fully static at build time instead, or is there a cache setup that works better for rarely visited URLs?&lt;/p&gt;

&lt;p&gt;The pages in question look like this: &lt;a href="https://www.utilixi.com/en/converter/military-time" rel="noopener noreferrer"&gt;https://www.utilixi.com/en/converter/military-time&lt;/a&gt;&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>vercel</category>
      <category>webdev</category>
      <category>performance</category>
    </item>
  </channel>
</rss>
