| 1 | === Staticize Reloaded === |
|---|
| 2 | Tags: caching, performance |
|---|
| 3 | Contributors: matt, billzeller |
|---|
| 4 | |
|---|
| 5 | Staticize Reloaded is a plugin to make your site faster by caching the output of some WordPress pages. It creates a unique key based on the page variables and user and then if a request is made with identical variables it serves the request from a static file rather than building the page from the database. When a post is updated or a comment is left the cache is cleared. It is ideal for sites with a lot of anonymous reads and not too many updates. (For example, during a Slashdotting.) |
|---|
| 6 | |
|---|
| 7 | == Installation == |
|---|
| 8 | |
|---|
| 9 | 1. Upload to your plugins folder, usually `wp-content/plugins/` |
|---|
| 10 | 2. If you have Compression turned on under Miscellaneous options, turn it off |
|---|
| 11 | 3. Activate the plugin on the plugin screen |
|---|
| 12 | 4. Caching should begin immediately. It's a good idea to deactivate when making template changes. To flush the cache just edit a post or comment. |
|---|
| 13 | |
|---|
| 14 | == Frequently Asked Questions == |
|---|
| 15 | |
|---|
| 16 | = Do I really need to use this plugin? = |
|---|
| 17 | |
|---|
| 18 | Probably not, WordPress is fast enough that caching usually only adds a few milliseconds of performance that isn't really perceptible by users. Some reasons you may want to use Staticize Reloaded: |
|---|
| 19 | |
|---|
| 20 | * If your site gets Slashdotted |
|---|
| 21 | * If you're on a very slow server |
|---|
| 22 | * If you've had a complaint from your host about performance |
|---|
| 23 | |
|---|
| 24 | = How can I tell if it's working? = |
|---|
| 25 | |
|---|
| 26 | Staticize Reloaded adds some stats to the very end of a page in the HTML, so you can view source to see the time it took to generate a page and rather it was cached or not. Remember that the cache is created on demand, so the first time you load a page it'll be generated from the database. |
|---|
| 27 | |
|---|
| 28 | = I see gibberish on the screen when I activate this plugin? = |
|---|
| 29 | |
|---|
| 30 | Make sure that you deactivated compression on the Miscellaneous options screen and that gzip encoding is turned off on the PHP level |
|---|
| 31 | |
|---|
| 32 | = How do I make certain parts of the page stay dynamic? = |
|---|
| 33 | |
|---|
| 34 | There are two ways to do this, you can have functions that say dynamic or include entire other files. To have a dynamic function in the cached PHP page use this syntax around the function: |
|---|
| 35 | |
|---|
| 36 | `<!--mfunc function_name('parameter', 'another_parameter') --> |
|---|
| 37 | <?php function_name('parameter', 'another_parameter') ?> |
|---|
| 38 | <!--/mfunc-->` |
|---|
| 39 | |
|---|
| 40 | The HTML comments around the mirrored PHP allow it to be executed in the static page. To include another file try this: |
|---|
| 41 | |
|---|
| 42 | `<!--mclude file.php--> |
|---|
| 43 | <?php include_once(ABSPATH . 'file.php'); ?> |
|---|
| 44 | <!--/mclude-->` |
|---|
| 45 | |
|---|
| 46 | That will include file.php under the ABSPATH directory, which is the same as where your `wp-config.php` file is located. |
|---|
| 47 | |
|---|
| 48 | == Screenshots == |
|---|
| 49 | |
|---|
| 50 | 1. This is a chart showing the performance of a WordPress blog under very high loads with and without Staticize. It was taken from <a href="http://weblogtoolscollection.com/archives/2004/07/26/staticise-analysis/">this post</a>. |
|---|