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

推荐订阅源

N
News and Events Feed by Topic
A
About on SuperTechFans
D
DataBreaches.Net
量子位
云风的 BLOG
云风的 BLOG
T
The Blog of Author Tim Ferriss
U
Unit 42
M
MIT News - Artificial intelligence
小众软件
小众软件
博客园 - Franky
GbyAI
GbyAI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Help Net Security
Help Net Security
Recorded Future
Recorded Future
The Last Watchdog
The Last Watchdog
S
Secure Thoughts
S
Security @ Cisco Blogs
MongoDB | Blog
MongoDB | Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
IT之家
IT之家
L
LINUX DO - 热门话题
H
Hacker News: Front Page
V
Vulnerabilities – Threatpost
Security Latest
Security Latest
C
CXSECURITY Database RSS Feed - CXSecurity.com
博客园 - 叶小钗
J
Java Code Geeks
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Hugging Face - Blog
Hugging Face - Blog
PCI Perspectives
PCI Perspectives
Cyberwarzone
Cyberwarzone
S
Schneier on Security
Scott Helme
Scott Helme
Microsoft Security Blog
Microsoft Security Blog
Attack and Defense Labs
Attack and Defense Labs
T
The Exploit Database - CXSecurity.com
C
Cisco Blogs
Y
Y Combinator Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
T
Tenable Blog
Google DeepMind News
Google DeepMind News
T
Threat Research - Cisco Blogs
H
Hackread – Cybersecurity News, Data Breaches, AI and More
www.infosecurity-magazine.com
www.infosecurity-magazine.com
V
V2EX
美团技术团队
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
大猫的无限游戏
大猫的无限游戏
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Know Your Adversary
Know Your Adversary

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
The Build Log: Rebuilding My Blog on Astro, Cloudflare Pages & Umami
Faiz Ahmed Farooqui · 2026-06-23 · via DEV Community

I already wrote about why I left Hashnode.
This is the other half: how the replacement actually works. Every meaningful
decision, the code behind it, and the bugs that cost me an afternoon — so future-me
(and anyone rebuilding their own site) doesn't relearn them.

The whole thing is an Astro site in a Git repo: profile and
blog on one domain, built to static HTML, served from Cloudflare Pages, with cookieless
analytics I host myself. No platform lock-in, no CDN I don't control.

The principles

Everything below falls out of four rules I set up front:

  1. Don't break the SEO. My posts have ranked for years. The migration had to be lossless.
  2. Own the assets. No hot-linking images or fonts from someone else's CDN.
  3. Ship almost no JavaScript. Static pages, a few small scripts, nothing more.
  4. Stay free and private. No per-seat SaaS, no cookies, no consent banner.

Content model

Posts are Markdown files, one folder per post, images colocated:

src/content/blog/<slug>/index.md

The collection uses Astro's Content Layer with a Zod schema. The important detail is
the public URL: it comes from a slug frontmatter field, not the folder name —
because the slug has to match the old Hashnode URL exactly.

title: "..."
datePublished: Mon Jun 13 2022 09:14:14 GMT+0000 (...)
slug: my-post-slug      # becomes /my-post-slug — the ranked URL
cover: ./cover.jpg      # local, optional
tags: a, b, c
series: encryption      # or null

Migration was a script. Hashnode's export gave me Markdown with their CDN image URLs;
I wrote import-posts.mjs to pull every post in, strip the repeated "About Me"
footer, ensure a series: field, and download every remote image into the post
folder
so nothing points at cdn.hashnode.com anymore. A second pass,
optimize-images.mjs, downsizes them with sharp.

Preserving SEO on the cutover

This was the part I refused to get wrong. Two pieces:

Canonical URLs. Every page declares its canonical on the apex host, driven by one constant:

const canonical = new URL(canonicalPath, CANONICAL_ORIGIN).href; // https://faizahmed.in/...

Path-preserved redirects. The old blog.faizahmed.in/<slug> URLs now 301 to
faizahmed.in/<slug> via a Cloudflare Redirect Rule — path preserved, so every ranked
slug maps 1:1. Because I kept posts at the root (no /blog/ prefix) and kept the exact
slugs, the redirect is lossless and the ranking signal consolidates onto one host.

Then sitemap.xml, per-topic RSS feeds, JSON-LD (BlogPosting, Person, WebSite),
and an allow-all robots.txt.

The bug that haunted returning visitors

My old Gatsby site had registered a service worker (gatsby-plugin-offline). That
worker was still installed in every returning visitor's browser, happily serving the
old cached site — even after I'd changed everything. A hard refresh doesn't help,
because the worker sits in front of the network.

The fix is a kill-switch service worker at the same path that unregisters itself:

self.addEventListener("install", () => self.skipWaiting());
self.addEventListener("activate", (event) => {
  event.waitUntil((async () => {
    for (const key of await caches.keys()) await caches.delete(key);
    await self.registration.unregister();
    const clients = await self.clients.matchAll({ type: "window" });
    for (const c of clients) c.navigate(c.url);
  })());
});

Served with Cache-Control: no-cache so browsers always re-fetch it. On a stuck
visitor's next visit, it wipes the old caches, unregisters, and reloads them onto the
live site — no action on their end.

Search with no backend

⌘K search is a static JSON index (/search.json) built at deploy time, filtered
client-side over title, tags, series, and an excerpt. No server, works in dev and prod.

The gotcha: I inject result rows with innerHTML, and Astro's scoped styles don't
apply to nodes created that way
— they don't get the scoping attribute. The fix was
moving the result-row CSS into a <style is:global> block. (This bites you again with
any JS-generated DOM — keep it in mind.)

Diagrams: Mermaid, and a render bug

Posts render Mermaid diagrams client-side. My first version used Mermaid's
startOnLoad, and diagrams silently refused to render. The cause: I import Mermaid
asynchronously, so by the time it initializes the load event has already fired and
startOnLoad never triggers. The fix is to render explicitly:

const { default: mermaid } = await import(mermaidUrl);
mermaid.initialize({ startOnLoad: false, theme });
await mermaid.run({ querySelector: "pre.mermaid:not([data-processed])" });

I also added a full-screen click-to-zoom viewer (scroll/pinch to zoom, drag to
pan) because a wide sequence diagram crammed into a text column is unreadable.

Tag hygiene

The import dragged in 220 tags across ~90 posts — mostly single-use, plus
spelling duplicates (ci-cd vs cicd, pci-dss vs pcidss). That's a pile of thin,
near-duplicate pages search engines hate. Two fixes:

  • A consolidate-tags.mjs script with a MERGE map rewrites variant spellings to one canonical tag, and removed slugs 301 to their canonical.
  • Tag pages with fewer than 2 posts get noindex, follow and are dropped from the sitemap — still navigable, no thin-content drag.

Analytics that actually counts

I run Umami — cookieless, no consent banner. But there's a catch
for a developer audience: ad/tracker blockers (and Brave Shields) block known
analytics hosts by name, so a big chunk of my readers never get counted.

The fix is a first-party proxy. A Cloudflare Pages Function serves the tracker and
forwards the beacon under my own domain, so to the browser it's all faizahmed.in:

// functions/u/[[path]].js
const SCRIPT = "https://cloud.umami.is/script.js";
const COLLECT = "https://gateway.umami.is/api/send";
export async function onRequest({ request }) {
  const path = new URL(request.url).pathname.replace(/^\/u/, "");
  if (path === "/script.js") return fetch(SCRIPT); // (cached, JS content-type)
  if (path === "/api/send")
    return fetch(COLLECT, { method: "POST", headers: { /* forward IP + UA */ }, body: await request.text() });
}

Because the browser only ever talks to my domain, I could also tighten the CSP back to
connect-src 'self'. And since I wanted to know what people click, a single delegated
handler fires a Umami event for every link — internal-link, outbound-link,
email-link, tel-link — with the URL and where it was clicked.

View Transitions (and making scripts survive them)

I enabled Astro's View Transitions so navigation feels instant and I could show a
small loader on slow loads. The trap: with client-side navigation, scripts that attach
listeners on load stop working after the first navigation, because the DOM gets
swapped. The pattern that fixes it — re-initialize on every navigation, bind
document-level listeners only once:

document.addEventListener("astro:page-load", () => {
  // bind listeners to the fresh elements here
});

transition:persist looked tempting for keeping the header's listeners alive, but it
doesn't preserve script-attached listeners on components — it cost me a round of
"why is the theme toggle dead." The astro:page-load re-init is the reliable way.

The Safari afternoon: Rocket Loader

Then everything broke in Safari — toggle, search, dropdown, all dead — while Chrome was
fine. The culprit was Cloudflare Rocket Loader, an "optimization" that rewrites and
defers your <script> tags at the edge. On a modern ES-module + event setup it breaks
things, and Safari most of all. It was also the original reason Mermaid misbehaved.

There's no in-repo fix — Cloudflare generates the rewrite after your build — so it's a
dashboard toggle: Speed → Optimization → Rocket Loader → Off. Verify:

curl -s https://faizahmed.in/ | grep -c rocket-loader   # want 0

On a static site this lean, Rocket Loader does nothing useful and only breaks things. Off, permanently.

GEO: optimizing for the AI engines too

SEO gets you ranked; GEO (Generative Engine Optimization) gets you cited by AI answer
engines. The cheapest high-leverage move is an llms.txt — a
curated, plain-text map of the site for LLMs. Mine is generated at build: a short bio,
the key pages, every series, and every post with a one-line description. Combined with
the allow-all robots.txt, clean JSON-LD, and semantic HTML, the site is easy for an
assistant to read and quote.

What it adds up to

  • Static Astro, zero UI framework, self-hosted fonts, locally-optimized images.
  • One domain, lossless 301s, canonical consolidation — SEO intact.
  • Cookieless, blocker-proof, free analytics I own.
  • Client-side search, rendered diagrams with zoom, View Transitions + a loader.
  • A tight CSP (connect-src 'self'), allow-all for crawlers and AI agents.

The biggest lesson? Most of my time didn't go into building features — it went into
the edge: a stale service worker, an "optimization" that broke Safari, scripts that
forgot to re-run after navigation. The platform you control is worth exactly these
afternoons.

It's all in a Git repo now. That was the whole point.