[wordpress插件] Batcache蝙蝠缓存

wordpress 插件 文章 2020-02-29 19:00 531 0 全屏看文

AI助手支持GPT4.0

评分
90
描述

Batcache uses Memcached to store and serve rendered pages.

Batcache使用Memcached来存储和提供呈现的页面。

It can also optionally cache redirects.

它还可以选择缓存重定向。

It’s not as fast as Donncha’s WP-Super-Cache but it can be used where file-based caching is not practical or not desired.

它的速度不比Donncha的WP-Super-Cache快,但是可以在不适合或不希望基于文件的缓存的情况下使用。

For instance, any site that is run on more than one server should use Batcache because it allows all servers to use the same storage.

例如,在多台服务器上运行的任何站点都应使用Batcache,因为它允许所有服务器使用相同的存储。

Development testing showed a 40x reduction in page generation times: pages generated in 200ms were served from the cache in 5ms.

开发测试显示页面生成时间减少了40倍:200毫秒内生成的页面在5毫秒内从缓存中得到服务。

Traffic simulations with Siege demonstrate that WordPress can handle up to twenty times more traffic with Batcache installed.

使用Siege进行的流量模拟表明,安装了Batcache的WordPress可以处理多达20倍的流量。

Batcache is aimed at preventing a flood of traffic from breaking your site.

Batcache旨在防止大量流量破坏您的网站。

It does this by serving old pages to new users.

它是通过向新用户提供旧页面来实现的。

This reduces the demand on the web server CPU and the database.

这减少了对Web服务器CPU和数据库的需求。

It also means some people may see a page that is a few minutes old.

这也意味着某些人可能会看到几分钟前的页面。

However this only applies to people who have not interacted with your web site before.

但是,这仅适用于以前未与您的网站进行交互的人。

Once they have logged in or left a comment they will always get fresh pages.

登录或发表评论后,他们将始终获得新鲜的页面。

Possible future features:

未来可能的功能:

    • Comments, edits, and new posts will trigger cache regeneration
    • 评论,编辑和新帖子将触发缓存重新生成

    • Online installation assistance
    • 在线安装帮助

    • Configuration page
    • 配置页面

    • Stats
    • 统计数据

安装步骤

    1. Get the Memcached backend working.

      使Memcached后端正常工作。

      See below.

      见下文。

    2. Upload advanced-cache.php to the /wp-content/ directory

      advanced-cache.php 上载到 / wp-content / 目录

    3. Add this line the top of wp-config.php to activate Batcache:

      将此行添加到 wp-config.php 的顶部以激活Batcache:

      define(‘WP_CACHE’, true);

      define('WP_CACHE',true);

    4. Test by reloading a page in your browser several times and then viewing the source.

      通过多次在浏览器中重新加载页面,然后查看源进行测试。

      Just above the closing tag you should see some Batcache stats.

      结束标记上方,您应该会看到一些Batcache统计信息。

    5. Tweak the options near the top of advanced-cache.php

      调整 advanced-cache.php 顶部附近的选项

    6. Optional Upload batcache.php to the /wp-content/plugins/ directory.

      可选 batcache.php 上载到 / wp-content / plugins / 目录。

    Memcached backend

    Memcached后端

      1. Install memcached on at least one server.

        在至少一台服务器上安装 memcached

        Note the connection info.

        注意连接信息。

        The default is 127.0.0.1:11211.

        默认值为 127.0.0.1:11211

      2. Install the PECL memcached extension and PECL memcached扩展

        -plugins.org/memcached/trunk/" rel="nofollow">Ryan's Memcached backend 2.0.

        -plugins.org/memcached/trunk/“ rel =” nofollow“> Ryan的Memcached后端2.0 。

        Use the 1.0 branch if you don't have or can't install the

        如果您没有或无法安装 1.0分支,请使用

        PECL extension.

        PECL扩展名。

下载地址
https://downloads.wordpress.org/plugin/batcache.1.4.zip
-EOF-

AI助手支持GPT4.0