惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Attack and Defense Labs
Attack and Defense Labs
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Recent Announcements
Recent Announcements
博客园 - 【当耐特】
博客园 - 三生石上(FineUI控件)
量子位
aimingoo的专栏
aimingoo的专栏
V
V2EX
Vercel News
Vercel News
B
Blog
M
MIT News - Artificial intelligence
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
The Cloudflare Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Hacker News: Ask HN
Hacker News: Ask HN
TaoSecurity Blog
TaoSecurity Blog
N
News and Events Feed by Topic
D
DataBreaches.Net
Blog — PlanetScale
Blog — PlanetScale
S
Secure Thoughts
U
Unit 42
博客园 - 叶小钗
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Hacker News - Newest:
Hacker News - Newest: "LLM"
N
News | PayPal Newsroom
Help Net Security
Help Net Security
S
Security Affairs
Microsoft Security Blog
Microsoft Security Blog
W
WeLiveSecurity
博客园 - Franky
Forbes - Security
Forbes - Security
Microsoft Azure Blog
Microsoft Azure Blog
博客园_首页
Schneier on Security
Schneier on Security
I
InfoQ
B
Blog RSS Feed
大猫的无限游戏
大猫的无限游戏
A
About on SuperTechFans
Webroot Blog
Webroot Blog
AWS News Blog
AWS News Blog
Last Week in AI
Last Week in AI
Security Archives - TechRepublic
Security Archives - TechRepublic
C
CERT Recently Published Vulnerability Notes
N
News and Events Feed by Topic
阮一峰的网络日志
阮一峰的网络日志
L
Lohrmann on Cybersecurity
SecWiki News
SecWiki News
Recent Commits to openclaw:main
Recent Commits to openclaw:main
J
Java Code Geeks

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
How I built 100+ crypto calculators in 6 languages on Astro
Konstantin I · 2026-05-23 · via DEV Community

A year ago I had a problem. Every time someone asked me "is mining still profitable?" or "what's my impermanent loss?" I'd find five different calculators across five different sites, each missing a feature, slow on mobile, and crowded with popups.

So I built a site for it. Then another. Then a hundred.

Today CryptoCalk has 100+ specialized crypto calculators running in 6 languages, served as static HTML from a CDN, no signup, no data leaving the browser. This is the technical story — what worked, what broke, and what I'd do differently.


TL;DR

  • Stack: Astro (SSG) + vanilla TS + plain CSS
  • Scale: ~108 calculators × 6 locales ≈ 650 static HTML pages
  • Why static: because Google still rewards real HTML, and because calc forms are perfectly cacheable
  • Hardest part: i18n routing without exploding bundle size
  • Live: https://cryptocalk.com

Why not Next.js / Vite SPA

The default 2026 reflex when you say "calculator" is React. I started there. It was wrong for this project.

Three reasons:

1. 108 calculators don't share state. A mining ROI calc has zero overlap with an impermanent-loss calc — different inputs, different formulas, different SEO intent. Shipping a 300KB React bundle to a user who needs one calculator is wasteful.

2. SEO is the whole game. Most of my traffic is people typing "asic mining calculator" into Google. Static HTML pre-rendered with the calculator visible (and a meaningful <title> and <h1>) ranks. CSR React with a "loading…" spinner does not — Googlebot indexes the empty shell.

3. CWV is hard with SPAs. Hydration costs you LCP. Route-change runtime kills INP. With a static page, LCP is literally "the time it took your CDN to send the HTML."

So: Astro. It lets me write components in any framework (or none) and emit static HTML by default. Hydration is opt-in per island. Each calculator page is a separate route, separate bundle.


The 108-calculator problem

The math: 108 calculators × 6 locales = 648 pages. Each one needs:

  • A different formula
  • Different input fields (a DCA calc needs "buy frequency", a tax calc needs "country" + "income bracket")
  • Localized labels, helper text, error messages
  • Locale-aware number formatting (commas vs dots, thousand separators)
  • Locale-aware currency (USD primary, but EUR, BRL, RUB, INR, TRY for context)
  • Localized SEO meta + JSON-LD

The naive way is to maintain 648 markdown files. That's a content-team job. The slightly smarter way is to define each calculator as data + a renderer.

What I ended up with (simplified):

// calculators/asic-mining.ts
export const calc = {
  slug: 'asic-mining',
  category: 'mining',
  inputs: [
    { id: 'hashrate',    type: 'number', unit: 'TH/s',    required: true },
    { id: 'power',       type: 'number', unit: 'W',       required: true },
    { id: 'electricity', type: 'number', unit: '$/kWh',   default: 0.10 },
    { id: 'pool_fee',    type: 'number', unit: '%',       default: 1.0 },
  ],
  compute: (i, { btcPrice, networkHashrate, blockReward }) => {
    const dailyBTC = (i.hashrate / networkHashrate) * blockReward * 144;
    const grossUSD = dailyBTC * btcPrice;
    const electricityCost = (i.power / 1000) * 24 * i.electricity;
    const netUSD = grossUSD * (1 - i.pool_fee/100) - electricityCost;
    return { dailyUSD: netUSD, dailyBTC, breakeven: i.power / netUSD };
  },
  seo: {
    en: { title: 'ASIC Mining Calculator', h1: 'Bitcoin ASIC Mining Profitability' },
    es: { title: 'Calculadora de Minería ASIC', h1: 'Rentabilidad de Minería Bitcoin ASIC' },
    // ... 4 more
  },
};

Enter fullscreen mode Exit fullscreen mode

A single Astro template at src/pages/[locale]/[slug].astro reads this and renders 6 pages per calculator at build time. Total build: ~45s on a 4-core box. Output: pure HTML + a thin (~3KB gzipped) JS island per page that handles the form submission and runs compute() in the browser.

No backend. Live prices come from the CoinGecko free API client-side. The calculator math is also client-side — your inputs never leave your browser. (This was a marketing decision as much as an engineering one. "Privacy-first calculator" sells.)


i18n routing without bloating

Astro has astro:i18n but I rolled my own router because I wanted full control over the URL structure:

  • English at root: /asic-mining-calculator
  • Other locales as subfolder: /es/calculadora-de-mineria-asic
  • hreflang tags emitted in every <head>
  • Localized slugs (not just labels) — this matters for ranking on Spanish-language queries

The mistake I made early: I tried to share a single messages.json file across the whole site. By the time I hit calculator #50, the file was 280KB. Every page shipped the whole dictionary even though it only needed the strings for that one calc.

The fix was boring but worked: one messages file per calculator per locale, statically imported into the corresponding page. Astro inlines only what each page references. Bundle size per page dropped from 280KB to ~6KB.

src/i18n/
  asic-mining/
    en.json   ← 1.2KB
    es.json   ← 1.4KB
    ...
  impermanent-loss/
    en.json
    ...

Enter fullscreen mode Exit fullscreen mode


The 6-language SEO trap

Six languages means six chances to get hreflang wrong. The combinations:

  • hreflang="en"/asic-mining-calculator
  • hreflang="es"/es/calculadora-de-mineria-asic
  • hreflang="pt"/pt/calculadora-de-mineracao-asic
  • hreflang="ru"/ru/калькулятор-майнинга-asic (or transliterated)
  • hreflang="hi"/hi/asic-माइनिंग-कैलकुलेटर
  • hreflang="tr"/tr/asic-madencilik-hesaplayicisi
  • hreflang="x-default"/asic-mining-calculator

If you forget the reciprocal links (every language version must point to every other version, including itself), Google quietly stops treating them as alternates and you end up with duplicate-content competition between your own pages.

I built a single Astro middleware that generates the full hreflang block from a central language config. One source of truth, can't drift. Took two hours and saved me a future panic.


Performance: keeping LCP under 1.2s globally

The cliché says "make it fast." The reality is more interesting:

  • No web fonts on first paint. I preload DM Sans but use font-display: swap, and the calculator UI is fully readable in system fonts during the swap window.
  • AdSense lazy-loaded after requestIdleCallback. Loading the ads.js synchronously in <head> was killing FCP by 800ms. Now it loads after first interaction or 3s, whichever first.
  • CoinGecko prices fetched lazy. A "Refresh price" button fires the fetch; on first load the page uses the last-cached price baked into the static HTML (regenerated every 15 min by CI). LCP no longer waits on a third-party API.
  • Critical CSS inlined per route. Astro does this automatically with its <style> block; the rest of the stylesheet streams in parallel.

Current numbers on a mid-range Android (Moto G Power, throttled 4G, US East CDN edge):

LCP : 1.1s
INP : 24ms
CLS : 0.00

Enter fullscreen mode Exit fullscreen mode

The 0.00 CLS is intentional — every ad slot has a reserved height. The ad either fills it or stays empty. No layout shift either way.


AdSense + privacy: the consent dance

Running AdSense in the EU, UK, and California means you need a CMP (Consent Management Platform). I tested three; ended up with Google's own free CMP because it auto-syncs with AdSense and didn't tank my fill rate.

The boring code that matters:

<script>
  // Set default consent to denied — required to load gtag *before* user choice.
  gtag('consent', 'default', {
    ad_storage: 'denied',
    analytics_storage: 'denied',
    ad_user_data: 'denied',
    ad_personalization: 'denied',
  });
</script>

Enter fullscreen mode Exit fullscreen mode

This runs before the GA tag. Without it you'll get "Consent not signaled" warnings in AdSense and reduced revenue.


What I'd do differently

1. I'd skip the Russian transliterated URLs. Initially I had /ru/калькулятор-майнинга-asic (Cyrillic). Then I discovered some browsers and link-sharing tools mangle the URL. Switched to romanized: /ru/asic-mining-calculator-ru. Lost some keyword density but kept link integrity.

2. I'd add IndexNow earlier. It's a 10-line integration that pings Bing instantly when content changes. I added it 8 months in. Bing indexation went from 60% to 95% within a week.

3. I'd separate the "marketing" pages from "calculator" pages on the build level. Right now they share a build pipeline. The marketing pages don't need the calculator runtime; pulling them apart would save another ~2KB on those routes.

4. I'd write more tests for the math. I have golden-file tests that compare my outputs against published references (CoinGecko, StakingRewards, etc) but only for ~30 of 108 calculators. The other 78 are tested by "people email me when something looks off." This is bad. I'm fixing it now.


Numbers

  • 108 calculators
  • 648 statically pre-rendered HTML pages
  • 6 languages
  • ~45s build time on 4-core CI
  • 3KB average JS per page (after gzip)
  • 0 signups required
  • 0 user data collected
  • DR 17 (Ahrefs, May 2026 — still climbing)
  • 3-4k weekly organic clicks across the 11-domain Calk Empire network

Try it

https://cryptocalk.com — pick a category, run a calc, no signup. If you spot a math bug or a missing calculator, open an issue or ping me.

If you're building something similar and want to compare notes on Astro at scale, i18n routing, or AdSense pain — DM on LinkedIn.


Konstantin Iakovlev is the founder of the 11-domain Calk Empire calculator network including calk.kz, calk.kg, and cryptocalk.com. 14+ years in internet marketing, 8+ years in financial analytics.