Caching plug-ins are many with a large set of parameters and functions -
without careful analysis it is impossible to make an intelligent choice . Having looked through the Internet, I did not find any really normal comparisons. There are only posts exclusively for attracting attention - descriptions of plug-ins. The usual thing - SEO pulses, so to speak. I even saw an attempt to make a comparative analysis of the three plug-ins, but there was nothing further than measuring the download speed through the online service. But how everything is arranged inside, what the optimization influences is not said. After all, each site is individual - you still need fine tuning - you need to understand the principle of operation for the optimal choice.
This article was created simultaneously with the creation of the
material , the focus of which is on the use of analysis results. Here I
want to share more details and methods of this analysis with sophisticated people and brothers in the shop.
Principles
WordPress consists of a variety of PHP scripts. Each time a site (server) is accessed, part of the scripts are executed and the result is output in the form of an HTML page. The main idea of optimization is to save time by issuing a ready-made result for rarely changing content.
Due to the urgency of the problem, many cache plugins have already been written and new ones appear. Also, you never want to pay too much, so only free and shareware solutions are compared.
')
The
main features that the plugin should have to provide high-quality caching are
highlighted :
- Server cache (server side cache)
- Page load time (page load time )
One of the most important parameters. The less time, the faster the client receives a response. You can of course choose a plugin with a lot of time, but then with high server loads you will have to increase iron performance, and these are costs that could have been avoided. - Caching method
Maximum preservation of all prepared HTML, JS, CSS objects, preferably also in a compressed state to save processing time on the server and increase the speed of outputting the result.
- Client cache (client side cache)
- When issuing the result, it is possible to manage the client browser cache. When activated, a repeated request to the server will not even come, which favorably affects its performance. It is specified in the form of TTL values (Time To Live, lifetime) for each type of object (HTML, CSS, JS, Images, ...). For critical objects, the values are small or equal to 0.
- Optimize (optimization)
- Combine
Download one common JS (or CSS) instead of several, because each additional server access is costly. Google Page Speed Test also speaks directly about this. - Inline (inclusion)
CSS content is inserted into HTML, which ultimately reduces the number of hits to the server. CSS is better to include, because in practice, it is difficult to divide it into necessary and not very parts. - Postpone (delayed download)
Delayed loading of JS scripts that do not affect the initial page display. It is also the most important metric that affects the speed of the page loading to the user. JS is better to postpone than to include directly in HTML, because they are usually easy to separate and inclusion will entail an increase in HTML, which can lead to loading in several iterations, which is equivalent to the appearance of additional requests. - Minify (minification)
HTML, JS and CSS content often contain unnecessary parts, such as spaces, line breaks, comments. All this is better to remove, to further reduce the size of objects. - Compress (compression)
Data compression algorithm GZip (Deflate) to reduce the amount of data transferred. Since HTML, JS and CSS are essentially text formats, they are well compressed.
- Manage
- Refresh
In the event that the requested object has changed (for example, a new article has been added), the object in the cache must be recreated, otherwise irrelevant information will be sent to users. Good plugins are set to auto cache updates for the most obvious events. And it should always be possible to reset the entire cache manually. It’s like a stop tap on a train - very rarely, but needed. - Exclude (add exceptions)
Sometimes you need to exclude some objects and pages from caching to troubleshoot problems. There must be sufficient control of this.
Plugin comparison
In order to compile a current study list, a selection of plug-ins was made through the well-known
wordpress.org c search for the words cache and a selection of the first 140 (10 pages) matching. It turned out 24.
By the way, if you think that some decent plug-in is not in the list - please write in the comments - I will add them to the analysis later.
Technique
- All tests were conducted on the same HTML page containing CSS, JS and several media objects to cover the most common range of types.
- Functionality checks were made for each criterion of the above and were tabulated.
- Each criterion is given a weight of importance of influence on the overall assessment (they are visible in the attached detailed table).
- The measurement of page load time was first done without optimization, then there was a measurement with the operation of each plug-in and a relative comparison of times was made. This ensures sufficient independence from the speed of hosting.
- The environment is the most recent:
- WordPress 4.9.8,
- PHP 7.2.10 with caching enabled (OpCache),
- MariaDB (MySQL) 10.3.9,
- Apache 2.4.35.
Each criterion was checked using the Chrome browser:
- In the debugging section, pressing F12 in the Network section clearly shows the times of different stages of loading and the HTTP headers of server responses for checking the control of the browser cache and compression. You can also see the combination of CSS and JS in one or more files.
- Through the View Page Source, the right button was used to analyze the output content for CSS inclusion, the quality of minification (only HTML, JS, CSS) and signs of deferred loading of JS scripts (the defer or async attributes should be present in the tag description of the script link).
- JS delayed loading was also checked on the preservation of the site’s performance, since Google Page Speed Test can show that everything is cool and the scripts do not work.
results
The main result of the analysis is a
detailed XLSX table , in which you can conveniently sort, filter and see the methodology for calculating the final weights. It also contains notes to the specifics of the plug-in when evaluating each criterion.
Each plugin is assigned roles based on test results for easy understanding of the spectrum of coverage of the required properties.
The following are summarized comparison results for an overall picture and convenience.
Conclusion
The resulting
table allows you to select plug-ins according to the necessary criteria and select combinations of several to maximize the coverage of the necessary criteria. In confirmation, 4 combinations were selected and tested (marked with bundle instead of version).
Specific settings are described in the material mentioned at the beginning of the article.
- Optimal use of different combinations of plug-ins, rather than separately.
- Low overall rating of the plugin is not a sign of its unsuitability. It can be good in some kind of separate functionality.
- Some plugins are incompatible with each other in combination.
- You should always check the correctness of the work of the delayed load of JS - some plug-ins are sufficiently additionally configured, and some still break the contents. The table made comments on this topic.
- And it is necessary to finally check through Google Page Speed Test (or other external meters like PingDom and others) - there may be different results on different sites, since optimizing plugins can behave differently.