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安装兼容。 p>
How does it work?
它如何工作? h4>
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目录中手动删除文件。 p>
Tips & Tricks
提示和技巧 h4>
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.
您可以通过在浏览器中打开页面的源代码并向下滚动到关闭的 code> 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-> p>
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 code>来禁用单个请求的缓存并获取原始html,例如:
http://example.com/?cache=false
http://example.com/?cache=false p>
You can disable cache for a single request and get the raw html by adding cache=false
HTTP header.
您可以通过添加 cache = false code> HTTP标头来禁用单个请求的缓存并获取原始html。 p>Logged-in users always get the raw html.
登录用户始终会获取原始html。 p>
Ideas for future versions
未来版本的想法 h4>
- Add support for Categories, Tags, Taxonomies, and Authors.
- 添加对类别,标签,分类法和作者的支持。 li>
- Add support for RSS/Atom feeds.
- 添加对RSS / Atom提要的支持。 li>
- Add support for Nginx and IIS servers.
- 添加对Nginx和IIS服务器的支持。 li>
- Add support for other WordPress Filesystem Methods.
- 添加对其他WordPress文件系统方法的支持。 li>
- Add regenerate function for all cache files.
- 为所有缓存文件添加重新生成功能。 li>
ol>
Requirements
要求 h3>
- Apache server
- Apache服务器 li>
- mod_rewrite
- mod_rewrite li>
- Write access to wp-content/cache directory
- 写入对wp-content / cache目录的访问权限 li>
- PHP interpreter version >= 5.3
- PHP解释器版本> = 5.3 li>
ol>