Skip to content

Web Development & Performance

Web Development, Optimisation & Production Deployment

Last reviewed

Server rack representing the hosting side of web performance

Summary: Fast, reliable websites come from shipping less to the browser, caching aggressively at every layer, keeping database queries indexed, and deploying through a staging environment rather than editing production. Measure with Core Web Vitals field data, fix the biggest offender, and repeat.

Core Web Vitals

Google's published 'good' thresholds, measured at the 75th percentile of page loads
MetricMeasuresGoodCommon fixes
LCP — Largest Contentful PaintLoading of main content≤ 2.5 sFaster TTFB, preload hero image, compress images
INP — Interaction to Next PaintResponsiveness≤ 200 msLess JavaScript, break up long tasks
CLS — Cumulative Layout ShiftVisual stability≤ 0.1Set width/height on media, reserve ad slots

Front-end asset delivery

  • Serve images as WebP or AVIF with responsive srcset sizes
  • Lazy-load below-the-fold images; never the main hero image
  • Self-host or preconnect web fonts and use font-display: swap
  • Compress text with Brotli or gzip
  • Fingerprint static files and cache them for a year
  • Use a CDN with Canadian points of presence

Server and database performance

Time to first byte depends on how quickly the server builds the page. Page caching removes most of that work; for dynamic pages, slow queries are usually to blame. Enable the slow query log and add indexes for the columns in WHERE and JOIN clauses.

Finding slow queries in MariaDB/MySQLsql
SET GLOBAL slow_query_log = 'ON';
SET GLOBAL long_query_time = 0.5;
-- Later, inspect a suspect query:
EXPLAIN SELECT * FROM orders WHERE customer_id = 42 ORDER BY created_at DESC;
-- If it scans the whole table, add an index:
CREATE INDEX idx_orders_customer_created ON orders (customer_id, created_at);

A safe deployment pipeline

From commit to production
  1. 01

    Git commit

    Version-controlled code

  2. 02

    Automated checks

    Build, tests, linting

  3. 03

    Staging

    Production-like copy for review

  4. 04

    Deploy

    Atomic release, keep previous build

  5. 05

    Monitor

    Errors, uptime, rollback if needed

Guides in this section

Get new technical guides by email

Occasional, practical server and hosting tutorials for Canadian webmasters. Unsubscribe any time.