Web Development & Performance
Web Development, Optimisation & Production Deployment
Last reviewed

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
| Metric | Measures | Good | Common fixes |
|---|---|---|---|
| LCP — Largest Contentful Paint | Loading of main content | ≤ 2.5 s | Faster TTFB, preload hero image, compress images |
| INP — Interaction to Next Paint | Responsiveness | ≤ 200 ms | Less JavaScript, break up long tasks |
| CLS — Cumulative Layout Shift | Visual stability | ≤ 0.1 | Set 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.
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
01
Git commit
Version-controlled code
02
Automated checks
Build, tests, linting
03
Staging
Production-like copy for review
04
Deploy
Atomic release, keep previous build
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.