SShortSingh.
Back to feed

Company site drops its server: static pages served from a CDN replace WordPress

0
·11 views

A company website that once ran on a rented WordPress server now has no server, serving 166 pages in nine languages from Cloudflare's network. A typical WordPress setup runs PHP and a database for every visitor, which requires constant updates and exposes it to security risks and downtime during traffic spikes. Static sites are pre-built into HTML files and delivered from nearby data centres, offering faster loading, fewer attack surfaces, and lower costs for typical company sites. Forms and similar features can run as small edge functions, while content editing can use a headless CMS. The article notes WordPress remains the better choice for sites needing complex plugins or frequent non-technical publishing.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Reducing Redundant Client Data Fetches With Ownership, Deduplication, and Freshness Windows

A common source of performance problems is the client, where screens, focus changes, rerenders, and global events repeatedly trigger requests for unchanged data. These redundant calls add server load, mobile data and battery costs, rate-limit pressure, and visual instability. The article recommends assigning each resource a single refresh owner, deduplicating concurrent requests by resource key with a single-flight pattern, and defining a bounded freshness window. It also advises keeping the last successful value when a refresh fails and ensuring store updates cannot retrigger their own synchronization. Using translation loading as an example, it argues that reference data and configuration should only sync during explicit lifecycle events rather than every time a user revisits a screen.

0
ProgrammingDEV Community ·

Why 'Works on My Machine' Happens and How Developers Can Fix It

Code that passes on a developer's laptop often fails in CI or production because the local machine holds hidden state the servers lack. Common culprits include unpinned dependency and runtime versions, gitignored environment variables, case-insensitive file paths on macOS, local timezones, and stale caches or globally installed tools. The article recommends committing lockfiles, pinning Node versions, keeping a committed .env.example with startup validation, matching file casing, storing dates in UTC, and testing under throttled networks. Its central advice is to make environments explicit and reproducible, for example through clean CI builds or Docker.

0
ProgrammingDEV Community ·

Reducing Query Count Makes APIs Faster Than Bigger Database Servers

A common cause of slow APIs is serialization silently triggering extra database queries for related data, known as the N+1 problem. Such issues often go unnoticed in development but become costly with production volumes, concurrent requests, and remote databases. The recommended fix is to map each response field to its data source, using select_related for single relationships and prefetch_related for collections. List endpoints should stay compact, with detailed data reserved for detail endpoints, and repeated counts moved into annotations or aggregate queries. Pagination should occur at the database level, with indexes supporting real filter and ordering patterns, and query counts should be measured and guarded by regression tests.

0
ProgrammingDEV Community ·

Making virtual-account fees traceable from deposit to wallet

A single virtual-account deposit can arrive over several payment rails, and each rail may carry its own fee structure, such as a percentage, flat charge, cap, threshold waiver, or no fee. If only the net credited amount is stored, neither customers nor operations can reconstruct how that amount was reached. The recommended approach is to persist the gross amount, rail, transaction fee, maintenance fee, net credit, conversion rate, and final wallet amount as separate components, with the fee policy snapshotted at transaction time. Moving funds between a virtual account and an application wallet should be handled as a linked transfer with matching debit and credit entries, shared references, and before-and-after balances. Staff adjustments should be recorded as explicit, attributable reconciliation entries, and idempotency keys with row locks help prevent duplicate crediting on retries. Unknown payment rails should fall under a conservative rule or go to review rather than defaulting to the cheapest fee.