WordPress static cache plug-in WP-Super-Cache detailed installation and configuration instructions

 

1. Installation of static cache plug-in

First, toBackstageClick on the install plug-in list and search for "”, the first one is to install it.

wordpress 静态缓存插件 WP-Super-Cache 详细安装与配置说明-1

2. Detailed configuration of static cache plug-in

After installing WP-Super-Cache and enabling it, go to the Settings option to set it. The specific settings are as follows:

first, in General, check Enable caching function (recommend).

Secondly, in Advanced:

1. Cache function, enable cache.

2. For cache implementation, check the simple mode.

3. Miscellaneous, do not check the cache for known users. Known users are mainly registered users of the website. If you do not check the administrator or user background login, there will be problems and you will not be able to jump;

Do not check the cache for GET requests, mainly because not checking it will affect the search page;

Check Compress pages to allow visitors to browse faster. Compressing web pages can speed up web page opening speed;

Cache the http header file containing the page content, optional or not;

Cache reconstruction is checked;

304 Unmodified Browser Cache is checked;

Let known usersCheck the box to enable the content they browse to be cached files;

Enable dynamic caching. Requires PHP or legacy mode caching. This requires special configuration, so leave it unchecked for now;

Mobile device support, check it to facilitate quick mobile access. The current development trend of mobile Internet is that the traffic of mobile access will gradually increase and exceed that of PC, so it needs to be paid attention to;

wp-super-cache

Remove the utf8 character set in the htaccess file without checking it;

Clear previous cache files when a new article or page is published or updated. There is no need to check it, otherwise posting an article will delete all previous caches;

Additional checks on the homepage can be checked;

When a page has new, only the cache for that page is refreshed. Check it, otherwise the visible content of the reply will still be invisible after the user logs in to reply. Please pay attention.

All latest cached pages are listed on this page. You don’t need to check it;

Coarse file is locked. You don't need this file as it will slow down your website. Check;

Initialize later. Display cache files after WordPress loads. Don't check it, don't check it, don't check it, otherwise waiting (TTFB) will be in the waiting state for a long time and the web page will open slowly. After many tests, when this option is checked, the most time-consuming part of the webpage is that TTFB is always in a waiting state, which takes almost 1.5s. If it is not checked, it only takes about 130ms;

wordpress 静态缓存插件 WP-Super-Cache 详细安装与配置说明-3

Files that are not cached. The homepage or home page is statically cached because it is related to the user’s first impression after entering the website. However, updating or publishing articles after caching does not need to be displayed.Add the following code to .php:

add_action('publish_post', 'refresh_front_page', 0); //Refresh the homepage when publishing or updating the log
add_action('delete_post', 'refresh_front_page', 0); //Refresh the homepage when deleting the log
function refresh_front_page(){
    $front_page_id = get_option('page_on_front'); //Get the page ID that displays the home page
    wp_cache_post_edit($front_page_id); //Refresh the page
}

In this way, the home page cache will be updated when an article is updated or deleted.

wordpress 静态缓存插件 WP-Super-Cache 详细安装与配置说明-4

The cache timeout is set to 0, which means it will never expire. The default for general projects is sufficient.

Precaching.Precaching will take up part of the space to cache all articles and pages on the site, so it is recommended to precache them all. (Shared hosting and too many articles are not recommended)

wordpress 静态缓存插件 WP-Super-Cache 详细安装与配置说明-5

3. Precautions

The static caching plug-in WP-Super-Cache is in the advanced level: first, do not check it for caching for known users; second, do not check it for initialization later, otherwise the website page will wait too long to load TTFB; third, it is required after the home page is cached Add update function in functions.php.

score

Leave a Reply

Your email address will not be published. Required fields are marked *