“WordPress Optimization/Caching”的版本间的差异

来自WordPress中文文档
跳转至: 导航搜索
(1个版本)
Server Caching: Recommend Opcache instead of APC, which is outdated, unsupported, and buggy.
第10行: 第10行:
  
 
Plugins like [http://wordpress.org/extend/plugins/w3-total-cache/ W3 Total Cache] or [http://wordpress.org/extend/plugins/wp-super-cache/ WP Super Cache] can be easily installed and will cache your WordPress posts and pages as static files. These static files are then served to users, reducing the processing load on the server. This can improve performance several hundred times over for fairly static pages.
 
Plugins like [http://wordpress.org/extend/plugins/w3-total-cache/ W3 Total Cache] or [http://wordpress.org/extend/plugins/wp-super-cache/ WP Super Cache] can be easily installed and will cache your WordPress posts and pages as static files. These static files are then served to users, reducing the processing load on the server. This can improve performance several hundred times over for fairly static pages.
 +
 +
When combined with a system level page cache such as Varnish, this can be quite powerful.
  
 
If your posts/pages have a lot of dynamic content configuring caching can be more complex. Search for "WordPress cache plugin" for more info.
 
If your posts/pages have a lot of dynamic content configuring caching can be more complex. Search for "WordPress cache plugin" for more info.
第23行: 第25行:
 
== Server Caching ==
 
== Server Caching ==
  
'''Web server caching''' is more complex but is used in very high traffic sites. A wide range of options are available, beyond the scope of this article. The simplest solutions start with the server caching locally while more complex and involved systems may use multiple caching servers (also known as reverse proxy servers) "in front" of web servers where the WordPress application is actually running. Adding an opcode cache like [http://pecl.php.net/package/APC Alternative PHP Cache (APC)] to your server will improve PHP's performance by many times.
+
'''Web server caching''' is more complex but is used in very high traffic sites. A wide range of options are available, beyond the scope of this article. The simplest solutions start with the server caching locally while more complex and involved systems may use multiple caching servers (also known as reverse proxy servers) "in front" of web servers where the WordPress application is actually running. Adding an opcode cache like [http://pecl.php.net/package/ZendOpcache Opcache] to your server will improve PHP's performance by many times.
  
For more on this type of server setup check out [http://highscalability.com/ High Scalability] site among others.
+
[http://www.varnish-cache.org/ Varnish] cache is very powerful when used with a WordPress caching plugin such as W3TC.
  
 
== Further Reading ==
 
== Further Reading ==
  
* [http://dougal.gunters.org/blog/2009/08/26/w3-total-cache-plugin W3 Total Cache Plugin] (by Dougal Campbell)
+
* [http://dougal.gunters.org/blog/2009/08/26/w3-total-cache-plugin W3 Total Cache Plugin] (by Dougal Campbell)  
 
* [http://ocaoimh.ie/wp-super-cache/ Holy Shmoly!: WP Super Cache]
 
* [http://ocaoimh.ie/wp-super-cache/ Holy Shmoly!: WP Super Cache]
 
* [http://developer.yahoo.com/performance/rules.html Best Practices for Speeding Up Your Web Site] - Expires / Cache-Control Header and ETags (by Yahoo! Developer Network)
 
* [http://developer.yahoo.com/performance/rules.html Best Practices for Speeding Up Your Web Site] - Expires / Cache-Control Header and ETags (by Yahoo! Developer Network)

2015年7月14日 (二) 03:50的版本

wordpress.org.cn This article is part of a series on WordPress Optimization

WordPress caching is the fastest way to improve performance. If your site is getting hit right now install W3 Total Cache or WP Super Cache.

Caching Plugins

Plugins like W3 Total Cache or WP Super Cache can be easily installed and will cache your WordPress posts and pages as static files. These static files are then served to users, reducing the processing load on the server. This can improve performance several hundred times over for fairly static pages.

When combined with a system level page cache such as Varnish, this can be quite powerful.

If your posts/pages have a lot of dynamic content configuring caching can be more complex. Search for "WordPress cache plugin" for more info.

Browser Caching

Browser caching can help to reduce server load by reducing the number of requests per page. For example, by setting the correct file headers on files that don't change (static files like images, CSS, JavaScript etc) browsers will then cache these files on the user's computer. This technique allows the browser to check to see if files have changed, instead of simply requesting them. The result is your web server can answer many more 304 responses, confirming that a file is unchanged, instead of 200 responses, which require the file to be sent.

Look into HTTP Cache-Control (specifically max-age) and Expires headers, as well as Entity Tags for more information.

Server Caching

Web server caching is more complex but is used in very high traffic sites. A wide range of options are available, beyond the scope of this article. The simplest solutions start with the server caching locally while more complex and involved systems may use multiple caching servers (also known as reverse proxy servers) "in front" of web servers where the WordPress application is actually running. Adding an opcode cache like Opcache to your server will improve PHP's performance by many times.

Varnish cache is very powerful when used with a WordPress caching plugin such as W3TC.

Further Reading

includeonlydiv style=clear:both; background-color:#FAEBD7; border:1px solid #CCCCCC; color:#000000; padding:7px; margin:0.5em auto 0.5em auto; vertical-align:middle;This page is marked as incomplete. You can help Codex by expanding it./div/includeonlynoinclude

Description

This Template is used by Codex:Template Messages.

Usage

pre 检查到模板循环:模板:Message /pre

Result

检查到模板循环:模板:Message

/noinclude