Hyper cache - caching on a WordPress blog. Hyper Cache - correct configuration of the WordPress caching plugin! Where is the cache time in WordPress?

Good day! It's no secret that WordPress is a multifunctional and convenient platform, but it is quite cumbersome. As traffic increases, the load on the server increases noticeably, performance decreases and, as a result, pages load slowly.

While working on optimizing my blog, I am extremely unhappy with this situation and once again I am trying to speed up page loading, improve behavioral factors, and save my own and others’ nerves.

All these processes happen on the server side. Accordingly, if there is a sharp increase in traffic, the server cannot cope due to its limited capabilities and causes errors. Pages do not open or load very slowly. If the server resource limit is exceeded, the account may be disabled.

Helps cope with stress and reduce appetite WordPress caching— when accessing a dynamic page, it is generated on the server as usual, but the final version is saved in static form in HTML format, i.e. This is a finished page.

During subsequent calls to the same page, the page from the cache is returned, and system resources are saved.

Hyper Cache - installation and configuration instructions

If you look at it from the very beginning, you can find many options for using various plugins for caching on WordPress, most of them have a similar principle of operation. Before working on this post, I tried installing several of the most famous ones, but I brought the most tangible results free plugin Hyper Cache.

Enabling Cache on WordPress

Before you start working with the plugin, you need to enable support for using cached pages on WP. This is done in the main configuration file wp-config.php, which is located in the WordPress installation folder. Open the file in text editor, I recommend using Notepad++ to avoid encoding problems, or use the built-in editor from your hosting control panel.

So, this line needs to be added to the configuration file:

define("WPLANG", "ru_RU");

Installing the Hyper Cache caching plugin

To install the plugin, you need to download it from the official trusted one, upload it via FTP to the plugins folder and unpack it. This is a very tedious method, in my opinion, I always install plugins directly from the admin panel: Plugins - Add a new one and then insert Hyper Cache into the search bar, the first one in the list is the required one:

I already have it installed, but I need to click on the Install link and then activate it. It is worth noting that work on this WP caching plugin does not stand still, as is often the case. Scheduled updates are carried out, functionality and security settings are improved, and compatibility with updates is ensured. Thus, the latest version to date is compatible with latest version CMS.

After installation and activation, a new item will appear in the administration console (Settings menu): Hyper Cache - it has numerous settings.

Setting up Hyper Cache, cache options on WordPress

For the plugin to work properly and to use the cache on WordPress, you must: detailed setup plugin. At the very top of the page there is a button to clear the cache - Clear cache - you will need it if you have made changes to the structure or design and want users to see updated versions of the pages.

Cache status

This item indicates the number of pages in the WP cache and the next time the cached pages will be reset.

Settings

  • Cached page timeout - the time during which a page in the cache is considered relevant. For pages that have expired, the blog cache will be cleared automatically and recreated the next time you access it.
  • Cache invalidation mode - indicates in which case a page should be deleted from the cache, I set it when an entry is changed.
  • Disable cache for commenters - the user leaves and then sees the current version of the page, and not the saved one. Those. there will be no confusion and he will see that the comment has actually been sent - either for moderation, or automatically posted.
  • RSS caching - I did not enable this feature because... When publishing a new article in RSS, it may appear with a delay, depending on the timeout set, and this is not good, especially if the information is new and very relevant.

Mobile Configuration

If there is a mobile version of the blog optimized for mobile devices, then the plugin will detect the device from which the login was made and save the cached page under a different name, which will allow you to show a saved copy of the same page optimized for various devices. Activation requires installed WordPress plugin Mobile Pack.

I haven't bothered with it yet mobile version, so I didn’t check the boxes next to the existing items.

Compression

Text optimization and transmission in compressed form. To save free disk space on the server, you can check the corresponding box. Again, by enabling these functions, compression occurs on the server side and therefore loses a small part of the performance and effect of caching.

I did not use these functions, you can try, just note that interruptions may occur, for example, blank pages will open.

Expert settings

  • Translation - if you want to see the Hyper Cache configuration page without translation, that is, in English, check the box.
  • Disable Last-Modified header - disable the time of its last modification in the page header.
  • Caching Home - check the box if you DO NOT want this home page was saved in the cache.
  • Caching redirects - if available, then you can leave the option enabled.
  • Page not found caching (HTTP 404) - whether to save pages with a 404 error.
  • Strip query string - clearing the URL from additional queries in address bar. It's something similar to .
  • URL with parameters - check if you do not use CNC and the page addresses contain a question mark.

Filters

  • Excluded URIs are addresses of pages that should not be cached.
  • Excluded agents are user agents (search bots, for example) for which the cache is not executed and always up-to-date versions of pages are shown.
  • Cookies Match - If the cookies match, the cache will stop executing.

Attention! For the changes to take effect, do not forget to click on the Update button under each block of the listed settings.

This is so wonderful and most importantly - free WordPress caching plugin. It is noteworthy that a registered and logged-in user does not see the cached version of the page, but the current one, which is very convenient when making changes. Are you already using cache on WP?

Hello dear readers! Do you have your own blog? If you are reading this post, then probably yes. Do you know that without the plugin that I’ll tell you about, your blog has 1000-1500 visitors. can your brain boil in a day? (just kidding of course). In general, a large load will be created on your hosting and pages will take a very long time to load for your users.

How to speed up your blog and reduce the load on the server? That's what this post is about. I present to you a cool plugin - . Many people already know about it, but those who don’t know should install it immediately.

I won’t burden you with heavy and incomprehensible expressions, caching, page generation, databases MySQL data etc. I will explain everything in Russian and clearly.

When visitors to your blog visit it by clicking on a link, your blog page is immediately generated, in short, displayed (collection of all photos, comments, text, etc.). I think you all understand this perfectly well.

This creates a certain load on your hosting. What if 1000 people visit your blog? Even more load. It’s okay if you came in and left, but people still have to surf the pages, so that’s another burden for you.

What does the Hyper Cache plugin do?

Hyper Cache caches entire WordPress blog web pages and stores their HTML versions in its cache folder. Therefore, when even 3,000 thousand users visit your blog, the load on the hosting will be minimal, since all the pages of your blog have already been generated and are located in the cache folder on your server. I think you understand. If not, write your question in the comments.

Well, now to the setup.

1. Download the plugin itself (button on the right) - download
2. Upload the hyper cache folder to your plugins folder wp-content/plugins/
3. Enable caching in WordPress.

To do this, you will need to open the wp-config.php configuration file for editing, which you can find in the root folder on your site’s server. You will need to add one line of code to the WordPress configuration file:

Define("WP_CACHE", true);

You can insert it anywhere in the wp-config.php file before the line:

/** Absolute path to the WordPress directory. */ if (!defined ("ABSPATH")) define ("ABSPATH", dirname (__FILE__) . "/");

I personally inserted this line where the parameters for the WP database are set:

/** Database name for WordPress */ define ("WP_CACHE", true); - define here ("DB_NAME", "a20230_blog");

4. Log in to the WordPress admin area, select the “Plugins” tab and find the line with the plugin . (activate the plugin).

5. Go to the admin panel again - “settings” - Hyper Cache.

If no warning messages appear in the settings window, then the cache in WordPress is ready to work. If warnings appear, setting access rights to 777 on the wp-content folder or wp-content/plugins/hyper-cache folder will most likely help.

This is necessary so that the plugin can create a folder in WordPress to store cached web pages of your blog. After the plugin creates this folder, you can return the permissions to the wp-content folder and the wp-content/plugins/hyper-cache folder back to 755, and to the cache or hyper cache folder that is located on your hosting (wp- content/plugins/hyper-cache/cache or wp-content/hyper cache), assign permissions to 777 so that the Hyper Cache plugin can write to and erase HTML files with the cache of blog web pages.

You can see their number in the hyper cache settings - “Total cached pages (cached redirects are also counted)” - the number will be indicated. This is such a cool plugin. Enjoy it friends!!!

P.S. How do you like the article? I advise you not to miss information about new free video courses and blog competitions!

Best regards, Alexander Borisov

Site in user browsers and reduce the load placed on the resource by the . The loading speed is increased due to the fact that each time users are given a ready-made and generated page (taken from the cache) rather than a page generated from scratch. The load on the server is reduced by reducing number of http requests.

Caching is vital on almost all modern websites and blogs. This is due to the exponential increase in hosting load even with relatively low traffic. And if there are a lot of visitors when caching is turned off, then the site will literally “brain boil” (pages will take a very long time to open, the site will periodically “go down”, that is, fail).

Installing the Hyper Cache plugin

The WordPress engine has at least several plugins that allow you to enable caching. One of the most popular and easy to use is Hyper Cache plugin. You can download it from the official WordPress repository - wordpress.org (download), after using the site search.

In terms of downloading and installation, no problems should arise, since everything happens here according to the standard scheme (we pull out the folder with all the files from the archive and copy it to wp-content/plugins). After unzipping, go to the admin panel and look for Hyper Cache among all installed plugins. Click the “Activate” button. You also need to change the access rights to the folder with all wp-content/plugins plugins to 777 (read and write). The final stage of installation is editing the wp-config.php file. The following line of code should be entered here:

define('WP_CACHE', true).

This completes the installation. After activation, the plugin will immediately begin its work (it will cache blog pages).

Setting up Hyper Cache and reducing the load on the server

There are very few settings in Hyper Cache. First of all, go to the “Main” tab.

Here you can specify the cache lifetime (the time during which cached pages will be stored on the server). The optimal time is from several hours to several days (it all depends on the specifics of the site, the frequency of content updates, traffic and other factors). The more frequently the content is updated and the higher the traffic, the shorter the cache time should be. I usually specify 24 hours for our blog. You need to enable compression if you do not have it active.

Secondly, go to the “Exceptions” tab. Here you can specify the pages that should be cached. For example, you can disable caching:

  • for the home page,
  • for page 404,
  • for the comment feed,
  • for RSS feed,

All other items can be left as default.


hyper cache "Exceptions" tab

In the next tab “ Mobile" you must specify " Operating mode” — > “Use standard cash”.


hyper cache "Mobile" tab

It is quite easy to check whether Hyper Cache is working or not. To do this, you need to access the blog from another browser or as an unregistered user. Look source of this page (of course, unless you have disabled caching for it in the plugin settings). At the very end of the code there should be a line like this.

Hi all! I want to tell you a story about my inattention, which prompted me to write this article. About a week ago my host provider ran preventive work, the time was agreed upon and there was a warning that the site would be down for 15-30 minutes. I thought it wasn’t that much and wasn’t particularly worried about it and went about my business.

During the preventive maintenance, the site was indeed down, but I didn’t really track the time. To my surprise, after finishing the work there was still no access to the site - there was a 403 error on it (read about error codes and server response), which means lack of client rights. Around the same time, a letter was written to the provider's support service. They responded quite quickly.

The reason for blocking the account was huge load on hosting. The support worker provided the server logs. at that time it was small - about 300 people per day, so the question of changing the tariff immediately disappeared. The site was turned on for me, although after a 5-hour scan for viruses and possible reasons overload. By the way, in total the site was down for about a day, and this affected its positions - the blog fell out of the top 10 for some queries in .

Before shutting down the site, I hung a banner from seohammera (you can read about automatic promotion systems), so suspicion fell on him. The banner was removed and everything seemed to be fine. We also sent a question to technical support about the load level - they answered that everything was fine. But I didn’t stop there and started looking for ways reducing hosting load.

Many areas were reworked and removed, I worked a little with php and did a lot of other little things, someday I will write a detailed article about reducing the load on hosting. Back at the beginning of the blog, I installed the Hyper Cache plugin, which is designed to reduce the load by caching pages. Because at that time I did not follow the installation rules, it turned out that this plugin did not work at all.

And everything was written in the installation instructions, but for some reason I didn’t pay attention to it. This is how the main means of reducing the load did not work all this time. So, the main topic of this article will be correct installation and configuration Hyper plugin Cache to the blog. Now the plugin is working fine, so you won’t repeat my mistakes.

Installing the Hyper Cache plugin

In the page that appears, enter the name of the plugin - Hyper Cache, it should be in first place. Install the plugin (you will be required to enter your ftp account details). You can also download the archive with the plugin from the official website, then download and install through the admin panel. All in all, install in any way convenient for you.

Done, the plugin is installed. In order to enable support for using cached pages, you need to add this line:

Define("WP_CACHE", true);

to file wp-config.php. You can insert a line anywhere in the file, as long as it is in a tag

now it is necessary for the folder wp-content set permissions to 777 (this can be done through an ftp client, for example Filezila). This is required in order to the plugin created a folder to store cached country files c. The folder is called cache. After he creates it, you can change the rights to wp-content back to 755, but to the folder cache(I have it in the folder wp-content, can also be in the folder with the plugin, look) permissions are set to 777 so that the plugin can write files there.

Now short and point by point:

  1. Installing the plugin
  2. Add a line to the file wp-config
  3. Set access rights to 777 on the folder wp-content
  4. Looking for a folder cache and also set the permissions to 777
  5. Returning to the folder wp-content rights 755

Ready. The plugin is installed, it is advisable to check if it works. Remember - the plugin creates a separate file for each cached page, but only when the user visits it. Those. the person came in, the page loaded, and was added to the cache. Also keep in mind that the latest version of the page will always be shown to you, and not from the cache (if you log into the site using your login). To check we do the following:

  1. Look into plugin parameters. If there are no warnings above, then everything is fine.
  2. If you already have materials and visitors on your site, then look at the line "Files in cache(current and outdated)” - there must be a number greater than 1.
  3. Go to the site without logging in(from another browser for example) and look at the code. At the end there should be a line like
  4. Go to the cache folder on the server (we also set permissions to 777). if it contains non-empty files, the plugin works correctly.

That's it, the plugin works and you can start configuring it from the admin panel.

Setting up the Hyper Cache plugin

So, go to the menu “Options - Hyper Cache”

Now let's go through each menu item. IN cache state you can see the current number of cached pages and the next date the cached pages will be reset. The latter is not clearing the cache, but refers to an item in the next menu. By the way, when making any changes, you must click the “Update” button under the block for the changes to take effect.

Configuration - main plugin parameters:

  • Cached page timeout— time after which all pages in the cache will be deleted. The default value is 1440 - a day, which is quite normal for blogs that are not updated too often.
  • Cache Invalidation Mode— specifies the condition under which the system will remove a page from the cache. The best option is when a record is changed.
  • Disable cache for commenters- a function that, when enabled, will see the user who left a comment the fresh version of the page, and not the saved (cached) one. A person will immediately see whether a comment is sent for moderation or posted immediately (depending on your preferences)
  • RSS caching— simply caching the blog news feed. There may be slight delays in delivery when enabled.
  • Allow browser caching— includes the ability to save a page on the user’s hard drive, further reducing the load on hosting

Configuration for mobile devices

Used if you have a mobile version of the site created using the WordPress Mobile Pack plugin, you can enable this option. The Hyper Cache plugin will create separate cached files under different names for mobile devices (according to your mobile theme settings) and redirect visitors to the created pages. I don’t have a mobile version, so I didn’t check this box

The plugin optimizes the text (on the server side) and transmits it to the user. Speeds up loading of website pages.

  • Store compressed pages— actually, enabling the function itself.
  • Send compressed pages- allows you to save bandwidth while compressing the page, if possible.
  • On-the-fly compression- again helps to increase the site loading speed if possible.

  • Translation— disables the Russian version of the plugin settings page.
  • Disable Last-Modified header— disables the time of its last modification in the page title.
  • Caching Home— disables caching of the home page (helps if the home page of the site is frequently updated).
  • Caching redirects— caches all WordPress blog redirects, reducing the time for processing them.
  • Page not found caching (HTTP 404)— enables caching of the 404 error page.
  • Strip query string— allows you to cache URLs with additional queries (addresses with?, =, &, etc.) as URLs without them
  • URL with parameters— enables caching of queries with a question mark. When CNC is enabled, you can not use it, although activating the option reduces the load (some robots send requests with?).
  • Allow browser to bypass cache- allows the browser to bypass caching. For example, when the page is reloaded.

Filters

  • Excluded URLs— pages that you want to exclude from caching. One per line.
  • Excluded Agents— user agents (for example, search robots), for whom you want to always show the latest version of the page.
  • Match Cookies— cancels caching when cookies match. One per line.

Don’t forget to click the Update button after changing the settings; each block has its own button.

If you did everything correctly, the plugin will start working and . I will talk about other ways to reduce it in the following articles. the topic is very relevant, since search engines, especially, pay attention to page loading speed. See you soon on the pages of the MonetaVInternet blog!

Hello friends!

It’s already been a week since I left warm countries, and I really want to go back. I brought a couple of kilos of mangoes with me in memory of the tropics, today I ate the last one, sadness. There was no winter in St. Petersburg this year, and now it’s raining and slushy outside. It's great that I have a blog where you can forget and escape from harsh reality.

This article will discuss one of the plugins for caching WordPress blogs. I'll tell you what caching is, why it's needed, and how to set it up.

Why do you need to cache website pages?

First of all, it is worth saying that caching allows you to reduce the size of the site and speed up its loading.

Browsers only understand pages in HTML format. If with static sites everything is simple - there is a ready-made page that is given to everyone who wants to see it, then with a CMS it is more complicated. A WordPress site is connected to a database, and every time a visitor accesses a page, the system sends a request to the database. What if a hundred users request a page at the same time? After all, it will be generated anew every time, which will create a large (and, most importantly, unnecessary) load on the server. This means that users will not be able to quickly access the necessary information (or even the hosting will shut down the site due to high load). Caching solves these problems.

Pages are cached (saved), and if initially when a page was requested it was loaded from scratch, the cached page will be loaded only once, and then will be presented in finished form to everyone who accesses it.

WordPress Blog Caching Plugin

If you have a blog on WordPress, caching can be implemented using a plugin. There is a choice: it can be WP Super Cache, W3 Total Cache or Hyper Cache. The latter will be discussed in the article due to its simplicity, practically translated into Russian interface and good performance indicators.

Hyper Cache is truly the optimal WordPress blog caching plugin. It's more about efficiency here: Hyper Cache shows the best results in speeding up sites.

But if you still consider different options, select a caching plugin for WordPress by trial and error. For example, the Hyper Cache plugin was found to be incompatible with the NoExternalLinks plugin. If you do not have compatibility problems, then choose a plugin that maximizes loading speed.

Hyper Cache for WordPress. Installation

It has been written about installing plugins more than once, but for beginners I will repeat it again. There are two ways. First:

  • Find it on the official website wordpress.org and download the Hyper Cache plugin.
  • Go to the control panel.
  • Open the “Plugins” section, click the “add new” button.
  • Click “download plugin”.
  • Select the downloaded zip archive.
  • Click “Install”.
  • Activate the plugin.

The second one is simpler.

Just go to the control panel in the “Plugins” section, click “Add new” and enter “Hyper Cache” in the search bar. Then click on “Install” and activate the plugin.

The plugin is now installed and can be customized.

Hyper Cache: how to configure

Go to the plugin settings. As the box at the top tells you, you should add the line “define ("WP_CACHE", true);" to your wp-config.php file. This line will set the “WP_CACHE” variable to “true” and enable caching.

You can add a line through the visual editor in the control panel of your . Open wp-config.php located in the root of the site and after the WPLANG line add the necessary code define("WP_CACHE", true);

Further configuration of the Hyper Cache plugin is done only in the site control panel.

The plugin is partially translated, but not completely.

Everything is clear with the translated paragraphs (the page caching time determines the period of time after which the information on the pages will be updated; “turn on compression” allows you to further compress the pages), but there are also paragraphs in English. They are more difficult to deal with, so questions may arise here.

How to configure untranslated items:

  • The “When a post receives a comment” item allows you to choose whether the plugin will update data for category and tag pages, search results and the main page, as well as the number of comments in the article preview. There are two options - update everything or update only the main page (or update nothing if both options are unchecked).
  • In “When a post is edited” you can set whether the above pages will be updated if you edited the text of the post itself.

The remaining fields have been translated into Russian.

In “Exceptions” you can choose which pages should not be cached. You can exclude both specific pages suggested by the plugin itself (home, 404 error, comment feed) and your own - just specify the URL, and Hyper Cache will not cache this page.

If you are showing content to mobile visitors that is different from desktop users, you should select “cache separately” in the “Mobile” tab. Otherwise, due to Hyper Cache, mobile users will see the same as desktop users.

This completes the Hyper Cache setup in WordPress. Watch the video about this plugin if you want more information:

Conclusion

Now you know how to configure the Hyper Cache plugin. It's intuitive, fun to use, and hopefully with the instructions above you won't have any problems installing it. Remember the importance of caching, because it makes the site faster, which both users and search engines love.

You need to be careful when choosing a caching plugin for WordPress. Check the compatibility of the plugin with your version of WordPress: often new versions of plugins do not work with old WordPress templates and vice versa, old addons do not always support new versions of this engine. Good luck!

P.S. As promised, I’ll tell you a little more about my trip to the Thai province of Kanchanaburi. This place gained popularity after the release of the American film “The Bridge on the River Kwai”; by the way, we watched it while there. Taking the train ride along the Death Railway along the river was a real treat, with such stunning views.

And then I decided to raft down the river Kwai, in front of surprised tourists (for some reason it never occurred to anyone to swim in the river). The little white star on the water is me :)

I wish you not to go with the flow, but to take fate into your own hands and do what you love, for example, blogging :) Bye!