[wordpress插件] CC-CacheCC缓存

wordpress 插件 文章 2020-03-19 11:20 623 0 全屏看文

AI助手支持GPT4.0

评分
0
描述

The CC-Cache plugin supports caching of Posts, Pages, and any public Custom Post Types – including single and archive pages.

CC-Cache插件支持帖子,页面和任何公共自定义帖子类型(包括单个页面和存档页面)的缓存。

It also supports a “static page display” option: Front page, Posts page, and standard Latest Posts listing.

它还支持“静态页面显示”选项:首页,帖子页面和标准的“最新帖子”列表。

This plugin is compatible with Multisite WordPress installations.

此插件与多站点WordPress安装兼容。

How does it work?

它如何工作?

When a user (i.e. someone who is logged out of WordPress) opens a page for the first time, the plugin saves all the rendered html to a file in the wp-content/cache directory.

当用户(即退出WordPress的用户)首次打开页面时,该插件会将所有呈现的html保存到wp-content / cache目录中的文件中。

From this moment onwards, any user who accesses the site will be served content directly from the generated html file.

从此刻起,将直接从生成的html文件中为访问网站的任何用户提供内容。

WordPress at this point is not initialized for this page.

目前尚未为此页面初始化WordPress。

The generated cache file will be removed when you make changes to the corresponding Post/Page, and then the process starts from the beginning.

对相应的“帖子/页面”进行更改时,将删除生成的缓存文件,然后该过程从头开始。

You can also clear all cached files from the Cache options page (visit the ‘Settings > Cache’ page in wp-admin), or manually delete files from the wp-content/cache directory.

您还可以从“缓存选项”页面清除所有缓存的文件(在wp-admin中访问“设置>缓存”页面),或从wp-content / cache目录中手动删除文件。

Tips & Tricks

提示和技巧

You can check if a page’s content is served from a cache file by opening the page’s source code in the browser and scrolling down to the closing html tag.

您可以通过在浏览器中打开页面的源代码并向下滚动到关闭的 html标签来检查是否从缓存文件中提供了页面的内容。

If the content is cached, you should see a comment with the date and time the page was last cached, for example:
    

如果内容被缓存,则应该看到带有上次缓存页面的日期和时间的注释,例如:
    

<!-缓存@ 2016-04-15 12:34:56->

You can disable cache for a single request and get the raw html by adding cache=false to a URL’s parameter, for example:
    

您可以通过为URL参数添加 cache = false 来禁用单个请求的缓存并获取原始html,例如:
    

http://example.com/?cache=false

http://example.com/?cache=false

You can disable cache for a single request and get the raw html by adding cache=false HTTP header.

您可以通过添加 cache = false HTTP标头来禁用单个请求的缓存并获取原始html。

Logged-in users always get the raw html.

登录用户始终会获取原始html。

Ideas for future versions

未来版本的想法

    1. Add support for Categories, Tags, Taxonomies, and Authors.
    2. 添加对类别,标签,分类法和作者的支持。

    3. Add support for RSS/Atom feeds.
    4. 添加对RSS / Atom提要的支持。

    5. Add support for Nginx and IIS servers.
    6. 添加对Nginx和IIS服务器的支持。

    7. Add support for other WordPress Filesystem Methods.
    8. 添加对其他WordPress文件系统方法的支持。

    9. Add regenerate function for all cache files.
    10. 为所有缓存文件添加重新生成功能。

    Requirements

    要求

      1. Apache server
      2. Apache服务器

      3. mod_rewrite
      4. mod_rewrite

      5. Write access to wp-content/cache directory
      6. 写入对wp-content / cache目录的访问权限

      7. PHP interpreter version >= 5.3
      8. PHP解释器版本> = 5.3

安装步骤

From your WordPress Dashboard

从您的WordPress仪表板中

    1. Go to ‘Plugins > Add New’
    2. 转到“插件>添加新内容”

    3. Search for ‘CC-Cache’
    4. 搜索“ CC缓存”

    5. Activate the plugin from the Plugin section in your WordPress Dashboard.
    6. 从WordPress信息中心的“插件”部分激活插件。

    From WordPress.org

    来自WordPress.org

      1. Download ‘CC-Cache’.
      2. 下载“ CC缓存”。

      3. Upload the ‘cc-cache’ directory to your ‘/wp-content/plugins/’ directory using your favorite method (ftp, sftp, scp, etc…)
      4. 使用您喜欢的方法(ftp,sftp,scp等)将“ cc-cache”目录上传到您的“ / wp-content / plugins /”目录中

      5. Activate the plugin from the Plugin section in your WordPress Dashboard.
      6. 从WordPress信息中心的“插件”部分激活插件。

      Once Activated

      一旦激活

        1. Visit the ‘Settings > Cache’ page, select your preferred options and save them.
        2. 访问“设置>缓存”页面,选择您喜欢的选项并保存。

        3. Add the following constant to your wp-config.php file: define( 'FS_METHOD', 'direct' );.
        4. 在您的 wp-config.php 文件中添加以下常量: define('FS_METHOD','direct');

        5. Add the rule listed in ‘Settings > Cache’ to the beginning of your .htaccess file.
        6. 将“设置>缓存”中列出的规则添加到 .htaccess 文件的开头。

        You can disable the cache function for individual posts and pages by marking the Disable checkbox in Edit Post/Edit Page.

        您可以通过标记“编辑帖子/编辑页面”中的“禁用”复选框来禁用单个帖子和页面的缓存功能。

        Multisite

        多站点

        The plugin can be activated and used for just about any use case.

        可以激活该插件并将其用于几乎所有用例。

          • Activate at the site level to load the plugin on that site only.
          • 在站点级别激活以仅在该站点上加载插件。

          • Activate at the network level for full integration with all sites in your network (this is the most common type of multisite installation).
          • 在网络级别激活以与网络中的所有站点完全集成(这是多站点安装的最常见类型)。

下载地址
https://downloads.wordpress.org/plugin/cc-cache.zip
-EOF-

AI助手支持GPT4.0