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

推荐订阅源

Apple Machine Learning Research
Apple Machine Learning Research
Y
Y Combinator Blog
量子位
The Register - Security
The Register - Security
雷峰网
雷峰网
人人都是产品经理
人人都是产品经理
PCI Perspectives
PCI Perspectives
S
Secure Thoughts
V
V2EX - 技术
大猫的无限游戏
大猫的无限游戏
博客园 - Franky
C
Comments on: Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Google DeepMind News
Google DeepMind News
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
小众软件
小众软件
博客园_首页
S
Schneier on Security
S
Security @ Cisco Blogs
AWS News Blog
AWS News Blog
月光博客
月光博客
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
CERT Recently Published Vulnerability Notes
NISL@THU
NISL@THU
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
V
V2EX
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
C
Cisco Blogs
Project Zero
Project Zero
博客园 - 叶小钗
Cisco Talos Blog
Cisco Talos Blog
博客园 - 聂微东
罗磊的独立博客
N
News | PayPal Newsroom
酷 壳 – CoolShell
酷 壳 – CoolShell
李成银的技术随笔
V
Visual Studio Blog
The Cloudflare Blog
IT之家
IT之家
M
Microsoft Research Blog - Microsoft Research
J
Java Code Geeks
博客园 - 三生石上(FineUI控件)
N
Netflix TechBlog - Medium
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
宝玉的分享
宝玉的分享
U
Unit 42
Hugging Face - Blog
Hugging Face - Blog

DEV Community

From Building WordPress Websites to Node.js APIs: My Honest Full Stack Journey XiHan Snore Coach: Privacy-First On-Device MedTech Guardian powered by Gemma 4 Mobile Why AI Coding Agents Hallucinate and How to Fix It mcp-probe v1.4.0: Contract assertions for production MCP servers Google I/O 2026 Wasn't About One More Model. It Was About the Agent Stack. The Dawn of Local Multi-Agent Architectures: Why Gemma 4 Changes Everything for Cloud Developers # I Told My AI to Simulate a Planet for 10,000 Years. It Built the Whole Thing Itself. 18/30 Days System Design Questions! From Hackathon Chaos to Clean CLI: Reviving My Daily Routine Analyser with GitHub Copilot Building a Home Lab with Proxmox and Terraform (for Kubernetes) PolicyAware vs Guardrails vs AI Gateways vs Model Routers: The Comparison Every AI Engineer Needs to Read Partner: An AI That Does Research While You Sleep Rugby Fundamentals as Software Concepts - Mapping the Pitch to your Code Base I Let Claude Code Run Unsupervised for 24 Hours. Here's What Happened. Why Zed Is Replacing VS Code in My AI-Augmented Workflow Build a scroll-driven WebGL hero in 30 lines Karpathy's LLM Wiki? No Code with Claude or Github Copilot! Why Platform Governance and Transparency Matter for Developers and Freelancers I built a Flutter CLI that generates Clean Architecture in seconds Using an LLM to automate a task that used to take hours by hand CyberArena – Interactive Cyber Security Simulation & Threat Analysis Platform Tile Extractor Mathematical Functions in CSS: clamp, min, max and How They Simplify Responsiveness Polyglot Persistence in Microservices: Let the Domain Choose the Database 190 Countries, Zero API Calls: Shipping Static Data in a Chrome Extension Your AI Writes Code Fast. Here’s How to Check It Before Shipping qwen2.5-coder is too slow for Claude Code on a Mac. Here's the fix. Building Automated Text-to-Video Pipelines with AI Can Gemini Become an Offline AI Tutor? Lessons from Building Educational AI OPRIX : From a simple messaging web app to a well structured and enhanced UI messaging web app Why React + TypeScript Nullability Slowly Becomes Exhausting Why AI Agents Need a Project Layer - Part 1 Stop Hand-Editing MCP Configs: A Zero-Dependency Go CLI What I Learned Working With Microsoft, SQUAD(GTCO), and Different Tech Communities 🧠 Hermes Agent Assistant — A Modular AI Agent System with Planner, Executor & Memory Spring Boot Auto-Configuration Source Code: Nail This Interview Question The Ultimate Guide to Free AI API Keys: 6 Platforms You Need to Know Why 91% of AI Agents Fail in Production (And What the 9% Do Differently) TryHackMe | Battery | WALKTHROUGH Stop Guessing Your Regex — Test It Live in the Browser I Built FreelancEye, an Open-Source Mobile PWA for Finding Clients Beyond the Hype: My Production Playbook for Docker Swarm Top AI App Builder Platforms with Integrated Backend, Hosting & Database ECS vs EKS in 2026: An Honest Comparison from Someone Who Has Run Both in Production Hardening Your Node.js App Against Supply Chain & Remote Code Execution Attacks linux commands A Practical GEO Case: How an AI System Started Recommending Our Blog Your AI Agent Works 24/7 and Earns $0. I Built the Fix. Your AI Trading Agent Will Lose All Your Money — Here's How To Stop It Google I/O 2026: What Happens When Everything Connects? Why AI writes software but doesn’t build a good product Beyond the Hype: How Google I/O 2026 Secretly Democratized Production-Ready AI Agents with Managed Sandboxes. The Killer Assumption Test: How to Spot Doomed Product Decisions Before You Ship Stop Describing Your Bugs — Just Screenshot Them # I Built an AI Website Builder and Here's What Actually Happened Cooking an AI Campaign in 5 Minutes with Google Cloud AI APIs Your PM Retrospectives Are Lying to You How I Built a Free, Self-Hosted Pipeline That Auto-Generates Faceless YouTube Shorts TypeScript 54 to 58: The Features That Actually Matter in 2026 How to Tailor Your CV to Any Job Posting in 2026 The 7-day SaaS MVP loop: ship fast, then validate with people who actually show up 95. Fine-Tuning LLMs: Make a General Model Do Your Specific Job What Is a Frontend Developer Roadmap and Why You Need One Google shipped three Gemini "Flash" models. Picking the wrong one could 6 your AI bill Building an MCP server so Claude can query my SaaS analytics directly Google I/O 2026 and the Rise of the AI Ecosystem Your Docker Builds Are Slow Because You're Doing It Wrong (And I Built a Tool to Prove It) How do you verify GitHub contributions without trusting self-reported skills? CV vs Resume: What's the Difference and Which Do You Need? student Devs: Build AI Agents & Compete for $55K in Prizes 🚀 How to Write a Cover Letter That Actually Gets You Interviews Battle-Tested: What Getting Hacked Taught Me About Web & Cyber Security Unda folders za kuandika code >> mkdir src >> cd src >> mkdir controllers database routes services utils >> cd .. Directory: C:\Users\mwaki\microfinance-system Mode LastWriteTime Length Name Code Coverage .NET AI slop debt" is technical debt on fast forward. Nobody's ready. Multi-Head Latent Attention (MLA) Memoria - A Local AI Reading Companion Powered by Gemma 4 Stop Trusting Your Accuracy Score: A Practical Guide to Evaluating Logistic Regression Models Serious Question: Is the Developer Job Actually in Risk Due to AI? published: true tags: #discuss #career #ai #help rav2d: We ported an AV2 video decoder from C to Rust — here's why Your New Domain's First Week of GA4 Is a Lie: 4 Days of Raw Data from a Launch Gemma Guide - Real-Time Spatial Awareness for Blind Users From YAML to AI Agents: Building Smarter DevOps Pipelines with MCP A Field Guide to Human–AI Relations (For the Newly Bewildered Mortal) The AI Agent That Learns While It Works — A Complete Guide to Hermes Agent Inviting collaborators to work on ArchScope ArchScope is an interactive web-based tool that lets you design, visualize, and test system architectures with real-time performance simulations. Github - ArchScope is an interactive web-based tool that lets you Gemma 4: Google's Open-Weight AI Is a Game Changer for Developers Confessions of a Git Beginner: Why the Terminal Stopped Scaring Me Docker 容器化实战:从零到生产部署 🚀 I Built a Full Stack Miro Clone with Real-Time Collaboration using Next.js Building an African Economic Data Pipeline with Python, DuckDB & World Bank API llms.txt vs robots.txt vs ai.txt: The Developer's Cheat Sheet Intigriti Challenge 0526 Writeup Business Logic Flaws: How Attackers Skip Steps in Your App to Get What They Should Never Have Why Vibe Coders Need Boilerplates to Save Time, Tokens, and Build More Secure SaaS Projects Idle Cloud Cost Is the New Egress Cost Quark's Outlines: Python Traceback Objects Ghost in the Stack (Part 1): Why uninitialized variables remember old data Building a High-Performance Local Chess Assistant Extension with WebAssembly Stockfish and Manifest V3 Breaking the Trade-off Between Self-Custody and Intelligent Automation on the Stellar Network
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.