Today there are thousands of techniques to enhance WordPress performance like using reverse proxies for caching, incorporating cache plugins and object caching, CSS minification, using sprites for images and many others. No doubt all of them are viable as well as effective ways to enhance the WordPress performance. Nevertheless, you must exercise care while using these techniques and must not fail to test how effective they are on your site. Here are some common problems that happen with different speed boosters and the solutions to fix them.
Reverse proxies like Varnish and Nginx
If used incorrectly, they can affect the accessibility of the site or show wrong information to visitors. For every request for the page, the web server needs to execute the PHP service to provide the page output. When a reverse proxy like Varnish and Nginx is enabled, the page is cached and the cached result will be displayed for a quick display. However, to work properly, the cache must be regularly purged whenever something is changed on the page failing which the results can be wrong. Especially this can happen while updating WordPress or introducing online store plugins for WordPress or using rating plugins on WordPress. The reverse proxy must be configured to purge the cache automatically during every update event in order to overcome this issue.
Problems with full-page caching plugins
If the hosting provider has not given you a reverse proxy caching service and you must rely on the full-page caching plugins for WordPress, the plugin will save the HTML output in a physical location on your server and serve it during eventual requests as an HTML file. This can display the page faster than not caching but much slower than the reverse proxy method. You must be careful while using such a caching mechanism on websites with many posts. A big website will have a large number of files and a heavy I/O load on the server will slow down the website and create problems with the hosting provider. Hence you must note this as one of the problems for your site to slow down.
For a website getting a lot of requests from a database, object caching can be a great solution. However, when Memcached service tries to store a huge number of images in the database, it will run out of space and hence will have to delete the pages cached previously on a first-in-first-out basis. In case of big files, no actual content can be saved as it would have got already removed before serving it for the second time. If you find the website slower than usual after enabling Memcached, the only way out is to disable Memcached service.
Though there are many risks involved in optimizing the speed of your WordPress site, you need not stop experimenting. For good results, the best way is not to change too many things at a given time. Make use of staging copies and benchmark the loading speeds of the site. After you apply every technique, test the website’s functionality. With this approach, you can speed up your website without affecting the functionality or causing problems for visitors.