Internet Windows Android

WordPress Super Cache plugin, use browser cache. How to set up wordpress caching? Hyper Cache settings to reduce server load

Recently, one of our readers asked us how to clear the WordPress cache? Your web browser, server, and plugins installed on your site may use a caching process that is unlikely to allow you to see the updated status of your blog.

In this article, we will show you how to properly clear the cache of your WordPress blog.

Caching solutions store a static version of your site. This allows WordPress to skip the heaviest PHP scripts and improve the performance of your site.


WordPress There are many types of caching solutions. The most popular are the "And" type cache plugins.

These plugins provide an easy-to-use interface for managing blog cache, cached content expiration, and on-demand caching.

WordPress hosting managed by providers like WPEngine uses their own caching solutions so you don't need to install this caching plugin.

If you are using a CDN service such as "MaxCDN" or "CloudFlare" it will also serve cached copies of static content.

If you use a web application firewall as "Or" to increase the security of WordPress, they also have their own cache to speed up your site and reduce downtime.

Finally, your browser may also store cached versions of pages on your computer.

The purpose of caching is to speed up your site and improve the overall user experience. However, sometimes it prevents you from seeing the changes you make to your site, which can be frustrating. In this case, you will need to clear your cache to see your changes.

However, let's see how to clear the cache in WordPress.

Step 1: Clear your browser cache

First, you need to clear your cache. Most web browsers can store static content such as style sheets, JavaScript, and images from a website to speed up subsequent visits.

However, sometimes web browsers may not realize that a web page has changed. Instead of getting a fresh copy, they can still reload the page from the cached version on your machine.

This is how you clear the cache of your Google Chrome browser. First you have to click on the menu icon and then select« Additional Tools > Clear Navigation Data .


A window will open where you can select the content you want to remove. Make sure the cached images and files are verified, and then click the " Clear browsing data P".


You have successfully cleared your browser cache and can now try to access your website.

If you still don't see any changes, continue with the next steps.

If you want to choose between the two best WordPress cache management plugins, check out our article:

For other web browsers, please refer to the respective documentation on how to wipe their caches.

Step 2: Clear the WordPress Plugin Cache

If you are using a WordPress caching plugin, you must clear your plugin's cache. Most caching plugins allow you to easily do this from the appropriate settings.

Clear cache from WP Super Cache

This allows users to instantly cache their site in one click. Its robot automatically selects your WordPress pages for cache generation and then automatically activates the recommended WordPress caching options such as GZIP compression, page caching, and cache preloading.

WP Rocket also includes additional features that you can enable to further improve your productivity. Including lazy loading of images, CDN support, DNS prefetching, minification, etc.

2.WP Fastest Cache

WP Fastest Cache is a WordPress cache plugin that offers just about everything a user might be looking for. The developers of this plugin claim that it is the simplest and fastest WP Cache system. And to be honest, it is! With over 300,000 active installs, this plugin offers visitors a fast browsing experience.

Caching data in WordPress allows you to speed up your site and significantly reduce the load on your server. There are three main types of caching in the kernel - page caching, object caching, and transitive caching. In this article, we will briefly cover all three types, as well as take a look at some of the popular WordPress caching plugins.

What is a cache?

A cache is an intermediate buffer that allows you to store the most frequently used data in memory or on a hard disk, which can significantly speed up the process of issuing them. Good examples where it is beneficial to use caching are:

Each of these queries can be accelerated using caching. For example, if we display our latest message from Twitter on the home page of the site, we don't have to make a request to Twitter every time we visit the home page.

It is enough to make one request on the first visit and save the result for a certain time in the cache, and on the next visit to the main page, we can return the saved result from memory much faster.

Caching in WordPress

There are three main types of caching in WordPress:

  • Page caching - allows you to save entire pages in the cache, and issue them from the cache on subsequent requests
  • Object caching - allows you to cache data of an arbitrary type
  • Transit caching - very similar to object caching, allows you to save data for a certain period of time

All three types of caching overlap or depend on each other under certain circumstances. We will talk about each type in more detail, starting with the simplest and most common.

Page caching in WordPress

It takes a lot of work to get a single WordPress archive page out. It's a few database queries to get the latest posts, widget settings, theme settings, active plugins, site title and description, background image, title, and much, much more.

Page caching (page cache) allows you to save the result of issuing the entire page. On a subsequent request to the same address, the same page is issued, but from the cache, respectively, much faster and with less load on the server.

When the content of a post or page changes, the page cache is reset, and the next request caches a new page with updated data.

Page caching is not implemented in the very core of WordPress, but there are all the necessary functions to implement this at the plugin level. The two most popular page caching plugins are WP Super Cache and W3 Total Cache, although there are others.

WP Super Cache Plugin

WP Super Cache is the most popular page caching plugin for WordPress. It allows you to create and serve static HTML files for your pages, and with a certain configuration, you can set up the issuance of these pages directly by your web server (Apache or nginx), bypassing the processing of PHP files in general.

New versions of the WP Super Cache plugin have some additional features, such as CDN setup, support for the mobile version of the site, and so on, but the essence of this plugin is page caching.

WP Super Cache is suitable for both beginners and more experienced WordPress users, but since it uses the file system for caching, it will be extremely difficult to use for a site with two or more web servers.

The W3 Total Cache plugin is younger than WP Super Cache, but not inferior to it in terms of functionality. It is gaining popularity very quickly, and today has over 2 million downloads from the WordPress.org directory.

W3 Total Cache allows you to store cached pages both on the hard disk and in memory. It does not preserve the cache structure, as WP Super Cache does, so it is impossible to customize the output without using PHP, but unlike WP Super Cache, using external storage makes it easy to work in a multi-server architecture.

W3 Total Cache has a huge amount of customization and additional functionality, including CDN support, database query caching, script and style compression, and much more. We recommend W3 Total Cache for more advanced WordPress users.

At the time of writing this article, the Batcache plugin has only been downloaded about ten thousand times from the WordPress.org directory, but in this case this is not an indicator of its effectiveness. In terms of performance, it is not inferior to either WP Super Cache or W3 Total Cache.

The Batcache plugin has only one function - page caching, but it does it flawlessly. Batcache uses external object caching to store data, making it easy to use in a multi-server architecture. This plugin is used by the massive WordPress.com network, with over 40 million sites, over 2000 servers and over 10 billion page views every month.

Which page caching plugin you choose depends on the size of your site, your capabilities, and your experience with WordPress. If you are not currently using page caching plugins, we always recommend starting with WP Super Cache. If more features and finer caching are important to you, try W3 Total Cache. If you are well versed in programming and server administration, and are ready to sacrifice a graphical interface when setting up, try Batcache.

Object Caching in WordPress

Object caching (object cache) is implemented in the very core of WordPress. This mechanism allows you to store objects of an arbitrary type in memory and is mainly useful for WordPress theme and plugin developers.

For example, when requesting an option from a MySQL database using the get_option function, WordPress will store the result of this function in memory, and the next time it is accessed, it will return the result from memory without making queries to the database.

Similar caching is implemented in the core for many objects, including: options, posts (pages, and custom types), post metadata, terms, and taxonomies. That is why WordPress developers should not be afraid to use functions like get_option and get_post , as such calls do not cause unnecessary requests to the database.

Object caching in WordPress is done using a number of internal functions, including: wp_cache_add , wp_cache_set , wp_cache_get .

Persistent object caching

It is important to know that WordPress object caching is not persistent by default. This means that the cached values ​​are valid for only one page request, and on subsequent requests, the cache is generated from scratch.

At first glance, this is not at all beneficial, but if you count how many times WordPress calls the get_option function to process a single request (about 500 times), then the benefit of object caching becomes obvious.

However, persistent object caching (or external cached) in WordPress is easily implemented using third party plugins like Memcached Object Cache or APC Object Cache . Both plugins allow you to use the server RAM to store WordPress objects, while the objects do not disappear when the request ends. This approach significantly reduces the load on the MySQL database.

It is also worth noting that when page caching is enabled, most often time does not reach working with saved objects, since the page is completely issued from the cache. This is not a reason to disable object caching, especially when dealing with logged in users, and some plugins (eg Batcache) generally use object caching to store pages.

Transit caching in WordPress

For users, this caching method is completely transparent. Transient caching (transient cache) allows developers to save data for a certain period of time. This method is implemented in WordPress with the get_transient , set_transient , and delete_transient functions.

Transit caching is most often used for fragment storage, especially when it comes to requests to external resources, such as to display a message from the Twitter network or to display the weather forecast from a third-party service.

Similar caching is also used in the core when working with RSS feeds, and requests to update themes, plugins and WordPress core.

Unlike object caching, transitive caching is persistent by default in WordPress, and stores all data in the database. But it's important to note that when using an external object caching plugin (like Memcached or APC), transitive caching will use that plugin for data storage.

Object caching or transitive caching?

Choosing between the two methods is fairly easy for developers. If we need to save the result for a certain period of time and for more than one request, it is best to use transitive caching. If we need to store a small object in memory only for the current request, object caching is suitable for us. If you need to save something for an indefinite period of time, the easiest way is to use the options - then there is a guarantee that the value will get into the database.

When using the plugin for persistent object caching, all three methods will use this plugin.

Conclusion

Caching plays an important role in improving the performance and speed of sites, as well as optimizing them for high loads. In most cases, for sites with low traffic, this is not so important, although it is always nice when the site opens faster.

For most sites, simple page caching solves all issues with speed and load. This is the first thing to do when problems arise, especially on cheap hosting sites. Page caching plugins are easy to install and configure.

Object caching and transitive caching are fairly transparent to WordPress users, but it's important for developers to be well aware of and separate the two mechanisms. Plugins for external object caching often require more effort to set up than page caching.

Finally, remember that caching is just one of the ways to increase the speed of your site. If speed is important to you, don't forget about image optimization, script and style compression, query and database optimization, use of CDN servers, and load balancing.

If you have any questions about caching in WordPress or problems setting up any caching plugin, leave a comment and we will be happy to help you.

02.07.2013 05.11.2013

Co-founder of WP Magazine and the first WordCamp conference in Russia. A developer at Automattic, he is actively involved in the development of the WordPress core. Favorite programming language: Python.

Hello dear blog readers In this article we will touch on the important topic of speeding up your blog on the WordPress platform and reducing the load on the hosting server using hyper cache.

is a wordpress caching plugin (wordpress cache). Be sure to use the wordpress cache and the loading speed of your site will increase significantly.

When you increase the number of visitors to your blog, a problem arises. When a reader wants to view a particular page on your site, they must wait for the server to generate it according to its wordpress theme and content.

How many times a certain page will be requested, so many times it will be created on the server again and again. The more visitors come to the blog, the greater the load on the server and the longer the load time.

All this can be avoided by applying the so-called caching or wordpress cache. What it is?

This is the process of saving the generated page at your request in a specific directory on the site using the Hyper cache plugin. Now, if someone else accesses the same page on the server, it will not be regenerated, but simply taken from the desired folder where it is stored wordpress cache and sent to the user's browser.

Thus, caching blog web pages is a very effective way to reduce the load on the hosting server and speed up the entire blog.

Hyper cache plugin. Installing and configuring wordpress cache.

It's very good that wordpress cache only works for unregistered users of your blog. In most cases, site owners do not allow visitors to register on their resource, and it turns out that the only person registered on the blog is the administrator, that is, you.

This means that for you personally wordpress cache won't work and that's great. Imagine that you made some changes on your blog (for example, in design), then it turns out that you will not see these changes until you reset the wordpress cache, and this would have to be done all the time.

Download caching plugin You can from the official wordpress site.

  1. Unzip the archive with the plugin and drop the Hyper cache folder into the wp-content/plugins/ plugins folder on your server using an FTP client
  2. Go to your blog console Plugins-Add New-Upload-Install

Enable wordpress cache.

To do this, open the wp-config.php configuration file for editing, which is located in the root directory of your blog and paste the following line of code there:

define('WP_CACHE', true);

This can also be done using the Filezila file manager.

Pasting can be done anywhere in the wp-config.php configuration file, somewhere closer to the end, but before the line:

/** Absolute path to the WordPress directory. */

if (!defined('ABSPATH'))

or, if in English:

/** WordPress absolute path to the WordPress directory. */

if (!defined('ABSPATH'))

define('ABSPATH', dirname(__FILE__) . '/');

Now we return to the Plugins blog console, find the Hyper cache caching plugin and activate it.

In order for the Hyper cache plugin to create a folder for the wordpress cache on the blog, you need to set permissions to 777 on the wp-content or wp-content/plugins/hyper cache/ folder. Read this about setting permissions.

Then the wp-content or wp-content/plugins/ hyper cache folders can be reset to 755 permissions, and the new wp-content/plugins/ hyper cache/cache folder can be set to 777, and then the Hyper cache plugin can write to or erase all HTML files from wordpress cache.

Configuring the correct operation of the Hyper cache plugin.

Let's go to the Hyper cache settings immediately after activating its work by clicking Options

Or the same thing will happen if you go to the blog console Settings - Hyper cache

In the Configuration area, the main part of the settings for the Hyper cache plugin will be made. First of all, check the box next to the Activate cache? And save the settings Save.

That's it, the wordpress cache is enabled, you can see further how many pages are cached in total.

Opposite the field Lifetime of cached pages you need to set the number in minutes, during this time an HTML copy of your web pages will be stored and any user will receive it from there during this time.

It doesn't make sense to keep the number low since most of the pages on your blog are not updated and are archived. It costs me 7200 minutes (5 days) This is how the well-known techie E. Popov advises.

You just need to see if the disk space on the server allows you to store a lot of cached pages. And it depends on the hosting plan that you bought for your blog and the number of visitors, or rather the number of pages that readers would like to see.

Basically, the disk space is at least 2-5 GB, so 7200 minutes will be just right.

The next field "Auto-cleanup every" is also intended for optimal use of disk space on the hard drive on the server. That is, every 1440 minutes (this corresponds to 1 day in my settings), notes whose lifetime has expired are deleted from the cache folder.

So unnecessary and useless files are deleted at the frequency that you set.

Using the field How to clear the cache you can specify how to clean up when updating an old material or when creating a new one:

- All- corresponds to updating the whole wordpress cache

- None- wordpress cache does not change

- Single page (Single page strikly) - the cache is updated only for the note in which changes have occurred

You can fill in this field as I have (see above) or choose it yourself.

In field gzip compression you can check the box, and then the wordpress cache files will be saved and sent in a compressed form, which will reduce the load on the server and increase the speed of the blog.

If there is a checkmark in the box Do not cache the home (Do not cache the home page), the home page will not undergo the caching process.

This may be necessary in case of frequent home page updates, when the very creation of the wordpress cache makes no sense, since the cache is often updated and then it does not matter where the page is being generated - from the cache or in the usual way.

If you do not want to cache any part of the blog, you can in the field exclude URI enter a part of the address (for example, blog categories /kartinki-foto-smeshno) and then pages containing this part of the URL will not be cached.

The rest of the settings can be left as is. Don't forget to click the Save button.

Next to the Save button is another very important Clear Cache button. You will need it when you redesign your blog and want blog visitors to see the updates as well. Otherwise, they will always be served only the old cached version of all pages.

The main work is done, you need to check if caching works on the blog using the Hyper cache plugin. To do this, follow these steps:

Access your blog using a different browser. It turns out that you are logged in as a regular visitor, not an administrator

Press the Ctrl-U buttons. You will see the source code of the page

Go to the very bottom of the source code. You should see something like the line

This means that the plugin is working, wordpress cache is created.

P.S. How do you like the article? Will you install a caching plugin?

A note coming soon about other ways to speed up your blog. I advise you not to miss her appearance and receive new

Igor gave himself completely to work in the company Myasnoff ...

I hope no one needs to explain why a caching plugin is needed and how important it is to choose one that will really help, and not just create an extra load on the database with its presence. In the analysis, we will take into account all indicators, and not just the download time.

Benefits of caching

A small digression. If, nevertheless, someone still doubts the need for caching, then you should know that since April 21, Google has announced that all mobile-friendly sites (and speed is one of the “friendly” components) get a significant advantage in search results. Google's intentions are very clear - SEOs and webmasters need to work on the performance of both desktop and mobile versions of the site.

There are several ways to improve the performance of your site and reduce its loading time, but for most beginner (and not only) optimizers, caching plugins are not one of, but the only tool used to achieve their goal.

WordPress generates pages dynamically, which results in a lot of database queries. Caching dynamically created pages allows users to see regular HTML pages, which significantly reduces page load time and reduces server load.

Details of the caching test

At the very beginning, it was planned to use 2 themes in tests - the simplest "twenty-fourteen" and a more complex one (which will imitate a "real" site). But during tests, it turned out that the effect of caching on the loading speed of the twenty-fourteen theme is so minimal that it can be neglected. The fine tuning of the server turned out to be more important, but today's article is not about that.

In the end, we will use only 1 theme (Novelty theme by Tesla Themes). The test page is designed using graphics and text. There is also a sidebar and several plugins (news, Twitter/Instagram feed). Hosting used by WP Dev Shed. As a result, we got a page with a relatively long load time.

Because the site is new, then it did not have traffic (including, during testing, there were not even PS bots). The server worked in a bunch of Apache + Ngnix.

The following plugins participated in the test:

  1. AIO Cache
  2. WP Fast Cache
  3. wp-cache.com
  4. Alpha Cache
  5. Flexicache
  6. Bodi0's Easy Cache
  7. Hyper Cache
  8. Hyper Cache Extended
  9. Cachify
  10. Lite Cache
  11. Next Level Cache
  12. Really Static
  13. Super Static Cache
  14. W3 Total Cache
  15. Gator Cache
  16. Wordfence Falcon
  17. WP Fastest Cache
  18. WP Rocket
  19. WP SuperCache
  20. Zen Cache (formerly Quick Cache)

The test left:

Brutal Cache - did not work;

Batcache is a plugin with a dependency on Memcache, which was not used in the current test.

Autoptimize and Widget Cache are also left out, because they are not standalone plugins, but support for others.

Benchmarking tools

As tools, we used services from Google, GTMetrix and Yahoo. Thanks to this, not only the page loading speed was tested, but also:

  • image optimization;
  • minification and optimization of js and css code;
  • using browser caching;
  • server time delay;
  • using Gzip compression;
  • placement of scripts;
  • number of HTTP requests.
  • use of CDN, parallelization/domain sharding;

Google PageSpeed ​​Insights

The site is checked both from the point of view of a desktop PC and from a mobile device. The result is given on a 100-point scale. The service is easy to use, but provides a relatively raw result that does not give a full understanding of everything that can be improved.

GTMetrix and YSlow

Based on the resource productivity guide from Yahoo. Again, a 100-point scale is used. Services work with more than 50 different metrics. GTMetrix even visualizes the data in a waterfall diagram of the loading process. In our opinion, this is one of the best tools for identifying ways to improve website performance.

Timing

The following tools were used to determine page loading speed and check server performance under load:

ApacheBench

Serves to determine the load on the site, calculates the maximum number of requests per second. During the test, 1000 requests were sent on 10 different threads. The test was carried out 10 times. Recorded the best result for each of the plug-ins.

A very well-known service for monitoring and testing sites. 20 tests were conducted with each plugin and the best result was fixed.

A simple but useful service that shows the full page load time in your browser. It's not a server tool, but a service that runs locally. We chose the method of downloading via Ethernet, the Opera browser. Each page was loaded 101 times with a fixed average load time.

So, let's get to the tests.

Google, GTMetrix and Yslow

The result of testing the site pages using the specified services:

As you can see from the table, some plugins didn't perform well here - the score is the same or very close to the score without caching. Google gave the best Super cache rating (for both desktop and mobile). In GTmetrix and Yslow, Fastest Cache and Rocket showed the best results. As we have already said, the rating from Google is less informative, because. it uses fewer factors in its evaluation.

So, the best plugins turned out to be WP Super Cache, WP Fastest Cache, and WP Rocket Cache.

Timing

Evaluation scores basically show the quality of the website code. This gives an understanding of what can be done to speed up the site. That being said, high site ratings do not mean that it loads faster than others. And this is the main mistake - evaluation tools give an abundance of ideas for improving the site to reduce loading time, but at the same time, loading time itself is practically not taken into account. Below is a good example (screenshot from Pingdom).

The page scored 96 out of 100 (better than 99% of any site's pages). At the same time, the page is loaded in about 35 seconds. This is where blind optimization can lead to.

Timing is a very important test because real measurements of page loading speed are carried out.

ApacheBench

Let's find out the maximum number of requests per second that our server can support. The higher the number, the better.

The best result was shown by WP Rocket. The second and third places were shared by WP-Cache.com and WP Fastest Cache.

The result without caching is 2.78 seconds. All plugins were able to improve this indicator.

The undisputed leader is again WPRocket. Super Cache is second, W3 Total Cache is third.

Here we decided to display not only the average, but also the median test result.

Average load time

The situation is similar to the previous test. The top three have not changed - WPRocket, WPSuperCache and W3 TotalCache.

Median download time

The leader is still WP Rocket, but the almost unknown WP-Cache.com again shows a very good result.

Not by caching alone

Of course, not everything depends only on caching. The choice of the Apache + Nginx bundle, the correctness of the server settings and its type (dedicated, VPS, shared), the number and quality (optimization) of images, and much more play their role.

Output

All the plugins presented have different functionality. Some are obscenely simple, while others can be compared to a Swiss knife. Super Cache, W3 and other similar plugins often use pros who are familiar with CDN and other tricks in their work. Other users (especially beginners) opt for simpler plugins (Lite Cache or WP-Cache.com). By the way, WP-Cache.com, despite its obscurity, was able to show excellent results.

What is the best WordPress plugin for caching?

In first place (by a wide margin) - WP-Rocket. It has many advantages, but there is one BUT (for many this will be a minus) - it is paid. Developers want $39 for it (moreover, updates are not life-time, but only a year)

In second place (although given the free, it can also be put on the first) -WPSuperCache. The results are almost the same as the leader, but it is absolutely free!

On the third - WP-cache.com. The only thing that confuses me is that it was last updated in 2014.

But it is simple, free and shows decent results.