Introduction
At MS Digital Solutions, we prioritize website performance as a critical component of your online success. A fast, optimized website enhances user experience, improves SEO rankings, and increases conversion rates. This comprehensive guide outlines our proven optimization process for WordPress websites host on Cloudways, utilizing a cache plugin, CDN, and other essential optimization techniques.
Table of Contents
Server Environment Optimization
Selecting the Right Server
- Choose appropriate server resources: Based on your website’s traffic and complexity, select a Cloudways server with adequate RAM, CPU, and storage.
- Consider location: Choose a server location closest to your target audience for reduced latency.
Cloudways Server Settings
MS Digital Solutions has entrusted our sites and our client sites that we host to the VPS environments at Cloudways for the last 6+ years. Their uptime, responsive support and high performance servers has made this partnership a very positive one.
1. Manage Services Configuration:
- Enable Memcached for object caching
- Enable Redis for persistent object caching
- Configure Varnish to work with and support the cache plugin’s internal cache
2. Server Monitoring:
- Regularly check server metrics to see if we are pushing the limits
- Monitor CPU usage, RAM consumption, and disk space
- Set up alerts for resource thresholds
PHP Configuration
PHP Version Selection
- Use the latest stable PHP version (currently PHP 8.2) for best performance – however the theme / plugin infrastructure on your site may limit the version we can use.
- We test your website thoroughly when upgrading PHP versions
PHP-FPM Settings
Having the correct PHP-FPM settings matter on your website application. But not all sites will have the same settings. – specific site settings may vary – here’s a fairly typical setup we start with.:
php_value memory_limit 256M
php_value max_execution_time 300
php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_input_vars 3000
OPcache Configuration
Enable OPcache to significantly improve PHP performance with these recommended settings:
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.revalidate_freq=60
opcache.fast_shutdown=1
opcache.enable_cli=1
Breeze Cache Plugin Setup
For most of our sites that are hosted at Cloudways, we use their proprietary Breeze cache plugin which can work on any site but is specifically optimized to the server environments at Cloudways.
Basic Options
- Cache System: Enable
- Purge Cache After: Set to 1440 minutes (1 day)
- Mobile Cache: Enable for mobile-specific caching
- Gzip Compression: Enable to reduce file sizes
- Browser Cache: Enable to add expire headers
- Disable Emoji: Enable to remove unnecessary emoji JavaScript
Advanced Options
There are a lot of things that we can do to speed up how the cache operates on your site. However some plugins and themes don’t play with caches as nicely as others. So we do a lot of testing of each setting to see what works, what doesn’t work, and what needs to be excluded from your site’s cache.
1. File Optimization:
- Enable HTML, CSS, and JavaScript minification
- Enable CSS and JavaScript grouping ONLY IF TESTING PASSES
- Move JavaScript files to footer ONLY IF TESTING PASSES
- Defer JavaScript loading ONLY IF TESTING PASSES
2. Preload Settings:
- Enable preloading
- Set up preload links
3. Cache Exclusions:
- Exclude admin pages, login pages, and cart/checkout pages
- Exclude any dynamic content pages that shouldn’t be cached
Database Optimization
We often find websites running unnecisarily bloated databases. Anything that increases the overall footprint of the site is going to have an impact on performance. So here is some things we look at and attempt to clean up.
1. Regular Cleanup:
- Post revisions: Keep 2-3 at most
- Auto-drafts: Remove
- Spam comments: Delete
- Trashed items: Empty
- Expired transients: Delete
2. Schedule Regular Cleanups:
- Set up monthly database optimization tasks
CDN Integration
Think of a CDN as a repository of your website files placed somewhere closer to your visitors browser than your server. This takes some of the workload off of your server and speeds up response times. Cloudways has a direct integration with the popular CDN, Cloudflare and we take advantage of that as much as we can.
Image Optimization with Imagify
We utilize Imagify to manage the size and type of images served by your site. Typically WordPress relies on classic web-friendly image formats such as JPG and PNG files. But we often find these to be uploaded at sizes not appropriate to how they are being used. Imagify allows us to batch resize and auto-thumbnail all images on the site as well as convert them dynamically to next generation image formats such as WebP.
Advanced Optimizations
WordPress Core Optimization
We also have some tricks up our sleaves for how we utilize WordPress itself to be a little more efficient, ease a little of the strain on the server, and otherwise protect the site.
1. Limit Post Revisions:
Add to wp-config.php:define('WP_POST_REVISIONS', 3);
define('AUTOSAVE_INTERVAL', 300); // 5 minutes
2. Disable XML-RPC:
Add to .htaccess file:# Disable XML-RPC
<Files xmlrpc.php>
order deny,allow
deny from all
</Files>
3. Optimize WP-Cron: (Cloudways has a simple setting to accomplish this
Plugin Management
1. Audit Plugins:
- Regularly review and remove unnecessary plugins
- Replace heavy plugins with lighter alternatives
- Use Query Monitor to identify slow plugins
2. Theme Optimization:
- Use lightweight, optimized themes
- Minimize custom fonts usage
- Optimize CSS delivery
Performance Monitoring
Regular Performance Testing
Our performance measuring tool is GTMetrix
1. Establish Baseline:
- Run initial tests and document scores
- Set performance benchmarks for future reference
2. Regular Monitoring:
- Schedule routine performance checks
- Track metrics: PageSpeed Score, YSlow Score, TTFB, and page load time
3. Performance Analysis:
- Identify and address any new performance issues
- Check waterfall charts to find bottlenecks
Maintenance Best Practices
Regular Updates
1. WordPress Core:
- Keep WordPress updated to the latest version
- Test updates on staging before applying to live site
2. Plugins and Themes:
- Regularly update plugins and themes
- Remove unused plugins and themes
3. PHP Version:
- Regularly update PHP to latest stable version
- Test for compatibility before updating
Backup Strategy
1. Automated Backups:
- Configure Cloudways automated backups
- Set appropriate backup frequency
2. Off-site Backups:
- Store critical backups off-site as additional security
Health Checks
1. Security Scans:
- Run regular security scans
- Monitor for malware and unauthorized access
2. Error Log Monitoring:
- Check PHP error logs regularly
- Address any recurring errors
Conclusion
This comprehensive optimization guide represents MS Digital Solutions’ commitment to delivering high-performance WordPress websites on Cloudways hosting. By implementing these best practices, your website will experience improved speed, better user experience, and higher search engine rankings. When we are engaged to help improve the speed of a site, this a pretty solid description for how our processes work.
Our team continuously monitors technological advancements and optimization techniques to ensure your website remains at peak performance. For personalized optimization assistance, please contact us.