PluginProbe ʕ •ᴥ•ʔ
WP Super Cache / 0.9.6
WP Super Cache v0.9.6
3.1.1 trunk 0.1 0.2 0.3 0.3.1 0.4 0.5 0.5.1 0.5.2 0.5.3 0.6.2 0.6.3 0.6.4 0.6.5 0.6.6 0.6.7 0.6.8 0.7 0.7.1 0.8 0.8.1 0.8.2 0.8.3 0.8.4 0.8.5 0.8.6 0.8.7 0.8.8 0.8.9 0.9 0.9.1 0.9.2 0.9.3 0.9.3.1 0.9.4 0.9.4.1 0.9.4.2 0.9.4.3 0.9.5 0.9.6 0.9.6.1 0.9.7 0.9.8 0.9.9 0.9.9.1 0.9.9.2 0.9.9.3 0.9.9.4 0.9.9.5 0.9.9.6 0.9.9.7 0.9.9.8 0.9.9.9 1.0 1.0.1 1.1 1.1.1 1.10.0 1.11.0 1.12.0 1.12.1 1.12.2 1.12.3 1.12.4 1.2 1.2.1 1.3 1.3.1 1.3.2 1.3.3 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.7.1 1.5.8 1.5.9 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.6.9 1.7.0 1.7.1 1.7.2 1.7.3 1.7.4 1.7.5 1.7.6 1.7.7 1.7.8 1.7.9 1.8 1.9 1.9.1 1.9.2 1.9.3 1.9.4 2.0.0 2.0.1 3.0.0 3.0.1 3.0.2 3.0.3 3.1.0
wp-super-cache / readme.txt
wp-super-cache Last commit date
plugins 17 years ago Changelog.txt 16 years ago advanced-cache.php 17 years ago readme.txt 16 years ago uninstall.php 16 years ago wp-cache-base.php 18 years ago wp-cache-config-sample.php 16 years ago wp-cache-phase1.php 16 years ago wp-cache-phase2.php 16 years ago wp-cache.php 16 years ago
readme.txt
237 lines
1 === WP Super Cache ===
2 Contributors: donncha
3 Tags: performance,caching,wp-cache,wp-super-cache,cache
4 Tested up to: 2.8.2
5 Stable tag: 0.9.6
6 Requires at least: 2.6
7 Donate link: http://ocaoimh.ie/wordpress-plugins/gifts-and-donations/
8
9 A very fast caching engine for WordPress that produces static html files.
10
11 == Description ==
12 This plugin generates static html files from your dynamic WordPress blog. After a html file is generated your webserver will serve that file instead of processing the comparatively heavier and more expensive WordPress PHP scripts.
13
14 The static html files will be served to the vast majority of your users, but because a user's details are displayed in the comment form after they leave a comment those requests are handled by PHP. Static files are served to:
15
16 1. Users who are not logged in.
17 2. Users who have not left a comment on your blog.
18 3. Or users who have not viewed a password protected post.
19
20 99% of your visitors will be served static html files. Those users who don't see the static files will still benefit because they will see regular WP-Cache cached files and your server won't be as busy as before. This plugin will help your server cope with a front page appearance on digg.com or other social networking site.
21
22 If for some reason "supercaching" doesn't work on your server then don't worry. Caching will still be performed, but every request will require loading the PHP engine. In normal circumstances this isn't bad at all. Visitors to your site will notice no slowdown or difference. Supercache really comes into it's own if your server is underpowered, or you're experiencing heavy traffic.
23 Super Cached html files will be served more quickly than PHP generated cached files but in every day use, the difference isn't noticeable.
24
25 See the [WP Super Cache homepage](http://ocaoimh.ie/wp-super-cache/) for further information.
26
27 The [changelog](http://svn.wp-plugins.org/wp-super-cache/trunk/Changelog.txt) is a good place to start if you want to know what has changed since you last downloaded the plugin.
28
29 == Changelog ==
30
31 = 0.9.6 =
32 * Add uninstall.php uninstall script.
33 * Updated cache/.htaccess rules (option to upgrade that)
34 * Added FAQ about category and static homepage problem.
35 * Add wp_cache_user_agent_is_rejected() back to wp-cache-phase2.php
36 * Show message for logged in users when caching disable for them.
37 * Check filemtime on correct supercache file
38
39 = 0.9.5 =
40 * Show next and last GC times in minutes, not local time.
41 * Don't serve wp_cache cache files to rejected user agents. Supercache files are still served to them.
42 * If enabled, mobile support now serves php cached files to mobile clients and static cached files to everyone else.
43 * Added checks for "WPSC_DISABLE_COMPRESSION" and "WPSC_DISABLE_LOCKING" constants to disable compression and file locking. For hosting companies primarily.
44 * Added check for DONOTCACHEPAGE constant to avoid caching a page.
45 * Use PHP_DOCUMENT_ROOT when creating .htaccess if necessary.
46
47 = 0.9.4.3 =
48 1. Added "Don't cache for logged in users" option.
49 2. Display file size stats on admin page.
50 3. Clear the cache when profile page is updated.
51 4. Don't cache post previews.
52 5. Added backslashes to rejected URI regex list.
53 6. Fixed problems with posts and comments not refreshing.
54
55 == Installation ==
56 1. You should have the Apache mod mime and mod rewrite modules installed and WordPress fancy permalinks enabled. PHP safe mode should be disabled. If any of those are missing or off you can still use the slower WP-Cache part of the plugin.
57 2. If you have WP-Cache installed already, please disable it. Edit wp-config.php and make sure the WP_CACHE define is deleted, and remove the files wp-content/wp-cache-config.php and wp-content/advanced-cache.php. These will be recreated when you install this plugin.
58 3. Upload this directory to your plugins directory. It will create a 'wp-content/plugins/wp-super-cache/' directory.
59 4. If you are using WordPress MU you will need to install this in 'wp-content/mu-plugins/wp-super-cache/' and the file wp-cache.php must be copied into the mu-plugins directory.
60 5. WordPress users should go to their Plugins page and activate "WP Super Cache".
61 6. Now go to Settings->WP Super Cache and enable caching. If you see an error message or a blank screen you may need to fix it. See the "FAQ" section later in this readme for instructions.
62 7. mod_rewrite rules will be inserted into your .htaccess file. Look in your web root directory for this file. It should look similar to this:
63
64 `-----------------.htaccess-----------------`
65 `RewriteEngine On`
66 `RewriteBase /`
67
68 `RewriteCond %{REQUEST_METHOD} !=POST`
69 `RewriteCond %{QUERY_STRING} !.*=.*`
70 `RewriteCond %{HTTP_COOKIE} !^.*(comment_author_|wordpress|wp-postpass_).*$`
71 `RewriteCond %{HTTP:Accept-Encoding} gzip`
72 `RewriteCond %{HTTP_user_agent} !^.*(2.0\ MMP|240x320|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|hiptop|IEMobile|iPhone|iPod|KYOCERA/WX310K|LG/U990|MIDP-2.0|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|Playstation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|Windows\ CE|WinWAP).*`
73 `RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz -f`
74 `RewriteRule ^(.*) /wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz [L]`
75
76 `RewriteCond %{REQUEST_METHOD} !=POST`
77 `RewriteCond %{QUERY_STRING} !.*=.*`
78 `RewriteCond %{QUERY_STRING} !.*attachment_id=.*`
79 `RewriteCond %{HTTP_COOKIE} !^.*(comment_author_|wordpress|wp-postpass_).*$`
80 `RewriteCond %{HTTP_user_agent} !^.*(2.0\ MMP|240x320|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|hiptop|IEMobile|iPhone|iPod|KYOCERA/WX310K|LG/U990|MIDP-2.0|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|Playstation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|Windows\ CE|WinWAP).*`
81 `RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html -f`
82 `RewriteRule ^(.*) /wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html [L]`
83
84 `RewriteCond %{REQUEST_FILENAME} !-f`
85 `RewriteCond %{REQUEST_FILENAME} !-d`
86 `RewriteRule . /index.php [L]`
87 `-----------------.htaccess-----------------`
88 8. After you have enabled the plugin, look for the file "wp-content/cache/.htaccess". If it's not there you must create it. It should read:
89
90 `# BEGIN supercache`
91 `<IfModule mod_mime.c>`
92 ` <FilesMatch "\.html\.gz$">`
93 ` ForceType text/html`
94 ` FileETag None`
95 ` </FilesMatch>`
96 ` AddEncoding gzip .gz`
97 ` AddType text/html .gz`
98 `</IfModule>`
99 `<IfModule mod_deflate.c>`
100 ` SetEnvIfNoCase Request_URI \.gz$ no-gzip`
101 `</IfModule>`
102 `<IfModule mod_headers.c>`
103 ` Header set Cache-Control 'max-age=300, must-revalidate'`
104 `</IfModule>`
105 `<IfModule mod_expires.c>`
106 ` ExpiresActive On`
107 ` ExpiresByType text/html A300`
108 `</IfModule>`
109 ``
110 `# END supercache`
111 9. Apache must be configured to allow the modules above. If you receive a "500 internal error" when serving requests to anonymous users you need to dig into your Apache configuration. This configuration in my virtual host works for me:
112
113 `<Directory /home/www/>`
114 `AllowOverride All`
115 `</Directory>`
116 10. wp-content/advanced-cache.php loads the caching engine. This file is generated by the plugin. Make sure the path in the include_once() is correct.
117
118 == How to uninstall WP Super Cache ==
119
120 Edit the file uninstall.php in your plugins/wp-super-cache/ directory and set
121 UNINSTALL_WPSUPERCACHE to a non blank value.
122
123 `define( 'UNINSTALL_WPSUPERCACHE', '1' );`
124
125 Open your browser and load wp-content/plugins/wp-super-cache/uninstall.php directly.
126 You must be logged in, and you must confirm the action. If you do not delete the plugin
127 immediately, after the script runs, please comment out the define() above to stop
128 someone else running it.
129
130 To manually uninstall:
131
132 1. Remove the WP_CACHE define from wp-config.php. It looks like `define( 'WP_CACHE', true );`
133 2. Clear the cache in the backend page and then deactivate the plugin on the plugins page.
134 3. Remove the Super Cache mod_rewrite rules from your .htaccess file.
135 4. Remove the files wp-content/advanced-cache.php and wp-content/wp-cache-config.php
136 5. Remove the directory wp-content/cache/
137 6. Remove the directory wp-super-cache from your plugins directory.
138
139 == If all else fails and your site is broken ==
140 1. Remove the WP_CACHE define from wp-config.php. It looks like `define( 'WP_CACHE', true );`
141 2. Remove the rules (see above) that the plugin wrote to the .htaccess file in your root directory.
142 3. Delete the wp-super-cache folder in the plugins folder.
143 4. Optionally delete advanced-cache.php, wp-cache-config.php and the cache folder in wp-content/.
144
145 == Frequently Asked Questions ==
146
147 = How do I know my blog is being cached? =
148
149 View the source of any page on your site. When a page is first created, you'll see the text "Dynamic page generated in XXXX seconds." and "Cached page generated by WP-Super-Cache on YYYY-MM-DD HH:MM:SS" at the end of the source code. On reload, a cached page will show the same timestamp so wait a few seconds before checking. If you have compression enabled, the text "Compression = gzip" will be added. If compression is disabled and the page is served as a static html file, the text "super cache" will be added. The only other way to check if your cached file was served by PHP script or from the static cache is by looking at the HTTP headers. WP-Cache (PHP) cached pages will have the header "WP-Super-Cache: WP-Cache". I used the <a href="https://addons.mozilla.org/en-US/firefox/addon/3829">Live HTTP Headers</a> extension for Firefox to examine the headers. You should also check your cache directory in wp-content/cache/supercache/hostname/ for static cache files.
150
151 = Why is WP-Super-Cache better than WP-Cache? =
152
153 This plugin is based on the excellent WP-Cache plugin and therefore brings all the benefits of that plugin to WordPress. On top of that it creates copies of every page that is accessed on a blog in a form that is quickly served by the web server. It's almost as quick as if the you had saved a page in your browser and uploaded it to replace your homepage.
154
155 = Will comments and other dynamic parts of my blog update immediately? =
156
157 Comments will show as soon as they are moderated, depending on the comment policy of the blog owner. Other dynamic elements on a page may not update unless they are written in Javascript, Flash, Java or another client side browser language. The plugin really produces static html pages. No PHP is executed when those pages are served. "Popularity Contest" is one such plugin that will not work. Plugins that show different content for mobile users will probaby not work either.
158
159 = Will the Super Cache compression slow down my server? =
160
161 No, it will do the opposite in fact. Super Cache files are compressed and stored that way so the heavy compression is done only once. These files are generally much smaller and are sent to a visitor's browser much more quickly than uncompressed html. As a result, your server spends less time talking over the network which saves CPU time and bandwidth, and can also serve the next request much more quickly.
162
163 = Why doesn't WP UserOnline, Popularity Contest, WP Postratings or plugin X not work or update on my blog now? =
164
165 This plugin caches entire pages and some plugins think they can run PHP code every time a page loads. To fix this, the plugin needs to use Javascript or AJAX methods to update. If the plugin displays information on the page, that must be a Javascript request too.
166
167 = Why doesn't the plugin cache requests by search engine bots by default? =
168
169 Those bots usually only visit each page once and if the page is not popular there's no point creating a cache file that will sit idle on your server.
170
171 = Why shouldn't I create a cache file of every page on my site? =
172
173 Like the previous question, there's no point caching pages that won't be visited. The large number of cache files will slow down the garbage collection system as it attempts to check each file. It also causes problems for hosting companies. In the event of a disk failure on your server it may take much longer to check the files. Remember how long a scandisk or a fsck took on a large drive?
174
175 = A category page is showing instead of my homepage =
176
177 A tiny proportion of websites will have problems with the following configuration:
178
179 1. Uses a static page for the front page.
180 2. Uses /%category%/%postname%/ permalink structure.
181
182 Sometimes a category page is cached as the homepage of the site instead of the static page. I can't [replicate the problem](http://wordpress.org/support/topic/237415/page/2?replies=38) but a simple solution is to switch the plugin to half-on mode. For normal traffic you will see no difference in the speed of your site.
183
184 = Troubleshooting =
185
186 If things don't work when you installed the plugin here are a few things to check:
187
188 1. Is wp-content writable by the web server?
189 2. Is there a wp-content/wp-cache-config.php ? If not, copy the file wp-super-cache/wp-cache-config-sample.php to wp-content/wp-cache-config.php and make sure WPCACHEHOME points at the right place. "plugins" should be "mu-plugins" if you're using WordPress MU.
190 3. Is there a wp-content/advanced-cache.php ? If not, then you must copy wp-super-cache/advanced-cache.php into wp-content/. You must edit the file and change the path so it points at the wp-super-cache folder.
191 4. If pages are not cached at all, remove wp-content/advanced-cache.php and recreate it, following the advice above.
192 5. Make sure the following line is in wp-config.php and it is ABOVE the "require_once(ABSPATH.'wp-settings.php');" line:
193
194 `define( 'WP_CACHE', true );`
195 6. Try the Settings->WP Super Cache page again and enable cache.
196 7. Look in wp-content/cache/supercache/. Are there directories and files there?
197 8. Anything in your php error_log?
198 9. If your browser keeps asking you to save the file after the super cache is installed you must disable Super Cache compression. Go to the Settings->WP Super Cache page and disable it there.
199 10. The plugin does not work very well when PHP's safe mode is active. This must be disabled by your administrator.
200 11. If pages are randomly super cached and sometimes not, your blog can probably be viewed with and without the "www" prefix on the URL. You should choose one way and install the [Enforce www preference](http://txfx.net/code/wordpress/enforce-www-preference/) plugin if you are using an old WordPress install. The latest versions redirect themselves (you should always be running the latest version of WordPress anyway!)
201 12. Private Server users at Dreamhost should edit wp-content/wp-cache-config.php and set the cache dir to "/tmp/" if they are getting errors about increasing CPU usage. See this [discussion](http://wordpress.org/support/topic/145895?replies=42) for more.
202 13. File locking errors such as "failed to acquire key 0x152b: Permission denied in..." or "Page not cached by WP Super Cache. Could not get mutex lock." are a sign that you may have to use file locking. Edit wp-content/wp-cache-config.php and uncomment "$use_flock = true" or set $sem_id to a different value. You can also disable file locking from the Admin screen as a last resort.
203 14. Make sure cache/wp_cache_mutex.lock is writeable by the web server.
204 15. The cache folder cannot be put on an NFS or Samba or NAS share. It has to be on a local disk. File locking and deleting expired files will not work properly unless the cache folder is on the local machine.
205 16. Garbage collection of old cache files won't work if WordPress can't find wp-cron.php. If your hostname resolves to 127.0.0.1 it could be preventing the garbage collection from working. Check your access_logs for wp-cron.php entries. Do they return a 404 (file not found) or 200 code? If it's 404 or you don't see wp-cron.php anywhere WordPress may be looking for that script in the wrong place. You should speak to your server administator to correct this or edit /etc/hosts on Unix servers and remove the following line. Your hostname must resolve to the external IP address other servers on the network/Internet use. See http://yoast.com/wp-cron-issues/ for more.
206
207 `127.0.0.1 myhostname.com`
208 A line like "127.0.0.1 localhost localhost.localdomain" is ok.
209 17. If old pages are being served to your visitors via the supercache, you may be missing Apache modules (or their equivalents if you don't use Apache). 3 modules are required: mod_mime, mod_headers and mod_expires. The last two are especially important for making sure browsers load new versions of existing pages on your site.
210 18. The error message, "WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed!" appears at the end of every page. Open the file wp-content/advanced-cache.php in your favourite editor. Is the path to wp-cache-phase1.php correct? If it is not the caching engine will not load.
211
212 == Custom Caching ==
213 It is now possible to hook into the caching process using the add_cacheaction() function.
214
215 Three hooks are available:
216
217 1. 'wp_cache_get_cookies_values' - modify the key used by WP Cache.
218 2. 'add_cacheaction' - runs in phase2. Allows a plugin to add WordPress hooks.
219 3. 'cache_admin_page' - runs in the admin page. Use it to modify that page, perhaps by adding new configuration options.
220
221 There is one regular WordPress filter too. Use the "do_createsupercache" filter
222 to customize the checks made before caching. The filter accepts one parameter.
223 The output of WP-Cache's wp_cache_get_cookies_values() function.
224
225 See plugins/searchengine.php as an example I use for my [No Adverts for Friends](plugin at http://ocaoimh.ie/no-adverts-for-friends/)
226
227 == Links ==
228 [WP Widget Cache](http://wordpress.org/extend/plugins/wp-widget-cache/) is another caching plugin for WordPress. This plugin caches the output of widgets and may significantly speed up dynamic page generation times.
229
230 == Updates ==
231 Updates to the plugin will be posted here, to [Holy Shmoly!](http://ocaoimh.ie/) and the [WP Super Cache homepage](http://ocaoimh.ie/wp-super-cache/) will always link to the newest version.
232
233 == Thanks ==
234 I would sincerely like to thank [John Pozadzides](http://onemansblog.com/) for giving me the idea for this, for writing the "How it works" section and for testing the plugin through 2 front page appearances on digg.com
235
236 Thanks to James Farmer and Andrew Billits of [Edu Blogs](http://edublogs.org/) fame who helped me make this more WordPress MU friendly.
237