1. Home
  2. Blog
  3. APIs, Backend & Security

APIs, Backend & Security

API design, backend reliability and web security: rate limiting, idempotency, webhooks and Content Security Policy.

Flat vector illustration of a long vertical list of data rows where an orange-red bookmark marker points directly at one row, beside a dark code panel, showing a cursor jumping straight to its place in the list
APIs, Backend & Security 15 min read

Cursor Pagination vs Offset Pagination: How to Page Through an API Properly

When to use cursor pagination or offset pagination in an API: why large offsets get slow, why pages repeat or skip items, keyset queries in SQL, opaque cursors, a Next.js route handler, response shapes, going backwards, and the mistakes I see most.

Flat vector illustration of mismatched error cards from a server passing through a press that turns them into identical rounded error cards with an orange-red tab, flowing into a browser window
APIs, Backend & Security 15 min read

API Error Responses: How to Use Problem Details (RFC 9457)

How I design API error responses with Problem Details from RFC 9457: the application/problem+json format, what type, title, status, detail and instance mean, which status codes to use, validation errors with JSON Pointers, an Express error middleware, a fetch helper and what never to leak.

Flat vector illustration of a browser window whose address bar carries an orange-red shield with a padlock that blocks a dashed insecure HTTP arrow, while a solid secure line runs to a server card
APIs, Backend & Security 16 min read

HSTS Explained: How Strict-Transport-Security Closes the HTTPS Downgrade Gap

A 301 redirect to HTTPS still lets the first plain HTTP request out. Here’s how HSTS closes that gap: the Strict-Transport-Security header and its directives, a safe max-age ramp, what breaks, the preload list and its requirements, setup in Nginx, Apache, Next.js, Vercel, Cloudflare and WordPress hosts, checking it with curl, and clearing it in Chrome.

Flat vector illustration of a server stack, a dark panel of masked trading logins, a candlestick chart and a broken orange-red padlock with a key
APIs, Backend & Security 8 min read

Onamae.com Desktop Cloud Breach: 26,739 Servers and Stolen Trading Logins

On October 21, 2026, GMO Internet, the Japanese company behind the Onamae.com brand, said someone had planted malicious programs on customer servers in its “Onamae.com Desktop Cloud” service. A day later it confirmed customers were seeing unauthorized activity on their trading accounts. GMO shut down every server on every plan. Here’s what’s confirmed, what isn’t, […]

APIs, Backend & Security 9 min read

Railway Security Incident (October 2026): What Happened to Your Env Vars

Between October 20 and 22, 2026, attackers broke into internal systems at Railway, the app hosting platform, and pulled customer environment variables. Some of those secrets were decrypted. Railway says the attacker was hunting for AI provider API keys. If you deploy on Railway, or on any platform that stores your secrets for you, this […]

APIs, Backend & Security 10 min read

PHP2Shell (CVE-2026-109618 and CVE-2026-109619): What It Is and How to Fix It

On October 21, 2026, the PHP project shipped emergency releases for two critical bugs that can let an attacker run code on your server without logging in. People are calling the pair “PHP2Shell.” If you run WordPress, Laravel, a custom PHP app, or anything on shared hosting, this one’s about you. Here’s what broke, who’s […]

Flat vector illustration of two browser windows on different origins linked by a request arrow through an orange checkpoint gate, beside a dark code panel of CORS response headers
APIs, Backend & Security 15 min read

CORS Errors Explained: Fix Preflight, Credentials, and Allowed Origins the Right Way

How I fix CORS errors: preflight OPTIONS, credentials vs the * wildcard, Vary: Origin, nginx always, and safe Express, Next.js and WordPress setups.

Flat vector illustration of an API gateway with a token bucket letting request cards through while excess requests are held back by an orange-red barrier
APIs, Backend & Security 21 min read

API Rate Limiting Done Right: Protect Your Backend Without Locking Out Real Users

Practical rate limiting for Node.js, Next.js route handlers and WordPress REST: token bucket vs sliding window, Redis keys, Retry-After headers, per-user vs per-IP rules, and how to avoid blocking real clients while stopping abuse.

Flat vector illustration of a webhook request envelope passing through an HMAC signature check shield into a secure server
APIs, Backend & Security 13 min read

How to Verify Webhook Signatures (HMAC) the Right Way in Node.js, Next.js and WordPress

Your webhook URL is public, so anyone can post fake events to it. Here is how I verify HMAC webhook signatures with the raw body, constant-time comparison and timestamp checks, with working Express, Next.js and WordPress code.

Flat vector illustration of a checkout request passing through an idempotency key gate so only one order is created despite repeated retries
APIs, Backend & Security 17 min read

Idempotency Keys in 2026: Stop Duplicate Payments and Double Submits in Your API

Learn how idempotency keys stop duplicate payments and double submits: the Idempotency-Key header, Postgres and Redis storage, 409 and 422 handling, safe retries, and webhook dedupe.

Shield with a padlock blocking injected scripts while trusted page resources pass: Content Security Policy against XSS
APIs, Backend & Security 11 min read

Content Security Policy in 2026: Lock Down XSS Without Breaking Your Scripts

Practical CSP in 2026: report-only rollout, nonces vs hashes vs strict-dynamic, WordPress and Next.js headers, GTM, and a checklist to stop XSS without breaking scripts.

Up and down to move, Enter to go, Esc to close

Before you go

Planning a website launch?

Read the checks I run before any site goes live: speed, SEO, forms, accessibility and backups.

Read the launch checklist Ask on WhatsApp