A fast website isn't just nice to have - it's essential. Visitors bounce, search rankings drop, and conversions plummet with every extra second of load time. Let's make your site lightning fast!
| Tool | What It Tests | Best For |
|---|---|---|
| Google PageSpeed Insights | Performance & Core Web Vitals | SEO focus |
| GTmetrix | Load time & waterfall | Detailed analysis |
| Pingdom | Load time from locations | Geographic testing |
| WebPageTest | Deep performance analysis | Advanced users |
| Metric | Good | Needs Work | Poor |
|---|---|---|---|
| LCP (Largest Contentful Paint) | < 2.5s | 2.5-4s | > 4s |
| FID (First Input Delay) | < 100ms | 100-300ms | > 300ms |
| CLS (Cumulative Layout Shift) | < 0.1 | 0.1-0.25 | > 0.25 |
| TTFB (Time to First Byte) | < 200ms | 200-500ms | > 500ms |
[SCREENSHOT: PageSpeed Insights results showing Core Web Vitals]
PHP 8.x is significantly faster than PHP 7.x:
| Version | Speed Improvement |
|---|---|
| PHP 7.4 → 8.0 | ~10% faster |
| PHP 7.4 → 8.2 | ~20% faster |
| PHP 7.4 → 8.3 | ~25% faster |
Upgrade in Enhance: Websites > Your Site > PHP Settings
OPcache compiles PHP scripts once and caches them:
; In php.ini or .user.ini
opcache.enable=1
opcache.memory_consumption=128
opcache.max_accelerated_files=10000
opcache.validate_timestamps=0 ; Set to 1 during development
| Server | Best For |
|---|---|
| Nginx | Static content, high concurrency |
| LiteSpeed | WordPress with LSCache |
| OpenLiteSpeed | Free LiteSpeed alternative |
| Apache | Legacy applications, .htaccess |
Switch in Enhance: Websites > Your Site > Settings
Configure in Enhance or via .htaccess:
# Browser caching
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/webp "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
</IfModule>
Compresses text-based files by 70-90%:
# Gzip compression
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/css
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/json
AddOutputFilterByType DEFLATE application/xml
</IfModule>
[SCREENSHOT: Compression settings in Enhance or .htaccess configuration]
Regular maintenance keeps your database healthy:
Via phpMyAdmin:
Via WP-CLI:
wp db optimize
Remove unnecessary data:
-- Delete post revisions (WordPress)
DELETE FROM wp_posts WHERE post_type = 'revision';
-- Delete spam comments
DELETE FROM wp_comments WHERE comment_approved = 'spam';
-- Delete transients
DELETE FROM wp_options WHERE option_name LIKE '%_transient_%';
Or use a plugin like WP-Optimize.
Speed up common queries:
-- Check slow queries
SHOW FULL PROCESSLIST;
-- Add index to frequently searched column
ALTER TABLE wp_postmeta ADD INDEX meta_value_index (meta_value(191));
Redis or Memcached caches database queries:
[SCREENSHOT: Redis enabled in Enhance with connection details]
Images often account for 50%+ of page weight!
| Format | Best For | Compression |
|---|---|---|
| WebP | Everything (modern browsers) | Excellent |
| JPEG | Photographs | Good |
| PNG | Graphics with transparency | Fair |
| SVG | Icons, logos | Perfect (vector) |
| AVIF | Future-proof option | Excellent |
Before uploading:
Automatic WordPress compression:
Serve appropriately sized images:
<img srcset="image-320.jpg 320w,
image-640.jpg 640w,
image-1280.jpg 1280w"
sizes="(max-width: 320px) 280px,
(max-width: 640px) 600px,
1200px"
src="image-1280.jpg" alt="Description">
Load images only when visible:
<img src="image.jpg" loading="lazy" alt="Description">
WordPress 5.5+ does this automatically!
Serves static HTML instead of running PHP:
WordPress plugins:
Manual caching:
// Start output buffering
ob_start();
// Your page content
echo "Hello World";
// Save to cache file
$cache = ob_get_contents();
file_put_contents('/cache/page.html', $cache);
ob_end_flush();
Tell browsers to store files locally:
<IfModule mod_headers.c>
<FilesMatch "\.(ico|jpg|jpeg|png|gif|webp|js|css|woff2)$">
Header set Cache-Control "max-age=31536000, public"
</FilesMatch>
</IfModule>
Cache database queries and PHP objects:
// Check cache first
$data = wp_cache_get('my_data', 'my_group');
if (false === $data) {
// Cache miss - get from database
$data = expensive_database_query();
// Store in cache
wp_cache_set('my_data', $data, 'my_group', 3600);
}
[SCREENSHOT: Caching plugin settings page]
A CDN serves your static files from servers worldwide.
| CDN | Free Tier | Best For |
|---|---|---|
| Cloudflare | Yes | Most websites |
| BunnyCDN | Trial | Cost-effective |
| KeyCDN | Trial | Pay-as-you-go |
| StackPath | Trial | Enterprise |
Remove whitespace and comments:
Before:
.button {
background-color: blue;
padding: 10px 20px;
/* This is a button */
}
After:
.button{background-color:blue;padding:10px 20px}
Tools:
<!-- Defer loading -->
<script src="script.js" defer></script>
<!-- Async loading -->
<script src="analytics.js" async></script>
Inline above-the-fold CSS:
<head>
<style>
/* Critical CSS here - renders immediately */
.header { ... }
.hero { ... }
</style>
<link rel="stylesheet" href="full.css" media="print" onload="this.media='all'">
</head>
Tools:
// wp-config.php
define('WP_POST_REVISIONS', 5); // Keep only 5 revisions
// Or disable completely:
define('WP_POST_REVISIONS', false);
// wp-config.php
define('WP_MEMORY_LIMIT', '256M');
Settings > Discussion > Uncheck pingback/trackback options
| Theme Type | Typical Page Size |
|---|---|
| Premium bloated theme | 3-5 MB |
| Optimised theme | 500 KB - 1 MB |
| Lightweight theme | < 500 KB |
Recommended lightweight themes:
Each plugin adds overhead. Regularly review:
| Metric | Before | After | Improvement |
|---|---|---|---|
| Page Size | 4.2 MB | 850 KB | 80% smaller |
| Load Time | 8.5s | 1.8s | 79% faster |
| Requests | 95 | 28 | 71% fewer |
| PageSpeed Score | 34 | 92 | 171% better |
[SCREENSHOT: Before and after PageSpeed scores]
Need more help? Browse our other Knowledge Base articles or contact our support team!