Everyone loves a quick website. Even search engines like Google say a site should respond within 200 milliseconds . this suggests you ought to keep your site lightning fast not just to stay your customers happy, but to retain your SEO rankings.
From image optimization to web server tuning, tons goes on behind performance tuning a WordPress site.
See how we speed up WordPress websites!
We monitor WordPress servers 24/7, quickly fix performance issues if we detect any, and periodically optimize the online and database servers. In a previous post we covered website specific optimization tips like plugin optimization and CSS/JS minification. Today we’ll cover the server optimization a part of WordPress performance tuning. Here are the WordPress server optimization steps included in our Server Management Services, that we’ve seen to be effective.
Get browsers to cache your site files
Almost 80% of those files are downloaded again when the visitor returns to your site again at a later point of your time , leading to an extended page load time. By asking browsers to cache your website files, you’ll get visitors to load your site pages really fast. In NginX, this is often done using the “Expires” tag, and in Apache, this is often done using “mod_expires”.
However, lookout once you use these directives. the design and functionality of your site depends on CSS and JS files, and if these sorts of files are cached for an extended time (eg. 30 days), your repeat customers won’t notice a topic or feature change in your site.
At Bobcares, we help WordPress site owners cash in of browser caching, but avoid common pitfalls by custom configuring expires directives.
Compress site files for faster download
A vast majority of the files during a WordPress site are text files like CSS, JS and HTML. These files are often compressed to one-tenth of its size, thereby reducing site load speed. In Apache, this will be done using the mod_gzip module, and in NginX it are often done using the “gzip” tag. it’s important to notice that while compression improves page speed, it can induce considerable CPU load, thereby slowing the server.
In some cases, we’ve used statically compressed files, and caching web servers to scale back CPU load while ensuring high compression rates.
Optimize the database
So, it’s vitally important to optimize the database every once during a while. At Bobcares, we detect database bottlenecks early, and fix them before it can hamper the web site .
Our server experts monitor database metrics like query latency, slow queries, memory usage, etc. in our customer servers to detect performance issues. Here are a couple of settings we tweak often in MySQL servers to stay up the server speed:
max_connections– In multi-user servers, this setting is employed to stop one user hogging the whole server. In heavily loaded shared servers, this limit are often as low as 10, and in dedicated servers, it are often as high as 250.
innodb_buffer_pool_size– In MySQL databases enabled with InnoDB, query results are stored during a memory area called “buffer pool” for fast access. We set this value anywhere between 50-70% of obtainable RAM for MySQL.
This is often set approximately at 20% of obtainable memory of MySQL.
query_cache_size– this is often enabled just for single website servers, and is about to 10MB or less counting on how slow the queries are at the present .
Get a quick PHP engine
Not all PHP engines are created equal. Older PHP engines like mod_PHP and suPHP are inefficient in their code execution. There are modern replacements like PHP-FPM, HHVM and PHP 7 which will give a moment speed boost to your scripts.
However, running these engines are often tricky. Here are a couple of common issues we faced:
Setup challenges– These engines run as a separate service, and Apache (or NginX) should be configured to expire all PHP files to the engine. additionally , the permissions on service sockets and PHP files should be set right.
Cache PHP execution results Many websites lately run on PHP, or other scripting languages.
There’s no reason why a second request for an equivalent page should take such a lot resources.
Some PHP engines like suPHP cannot cache PHP files, and enabling high compression on caches can induce high server load. We periodically audit the performance of cache systems, and adjust the server settings to stop build-up of stale data, and to stop over-use of server resources.
Bypass PHP engine by caching HTML pages
If there’s something better than a PHP cache, it’s an HTML cache. All WordPress sites are sent out as HTML files, and a majority of visits are often satisfied with a pre-generated HTML page.
There are several HTML cache systems that employment with PHP. One that we like is Varnish. Varnish keeps all recurring file requests (such as images, files, etc.) within the RAM in order that system resources needn’t be used unless there’s a replacement page request.
Use HTTP/2 rather than HTTP 1.1
A vast majority of internet sites use HTTP protocol v1.1. this is often an old version released in 1997 that forces browsers to download files for a page sequentially one after another.
A new version of HTTP, that’s HTTP/2 was released in 2015, and is supported by all major browsers and web servers. It provides many speed boosting features like multi-file transfer per connection, compressed headers, etc.
As with everything nice, adopting HTTP/2 comes with a few of caveats:
Convert the location to HTTPS– Major browsers like Chrome and Firefox support HTTP/2 only over fully encrypted HTTPS connections. Converting the entire site to HTTPS can get tedious. In our customer sites, we had to exchange http links with https, setup auto-renewable SSL, and test all functions until we could release it to production.
Monitor for vulnerabilities– HTTP/2 remains new. While the protocol itself is robust , there might be vulnerabilities within the server code. So, it’s important to stay an in depth eye on security news, and patch the server if there’s a problem . In Aug 2016, 4 HTTP/2 vulnerabilities were disclosed, which we were ready to patch in customer servers within 24 hours.
Today we’ve covered a couple of steps we’ve found to be effective in our WordPress server management services. If you’d wish to skills our services can make a difference to your site, we’d be happy to speak to you.