Staticize Reloaded

The caching plugin I pointed to the other day was very well-executed but it didn’t meet my needs for several reasons, mainly that it cached every bit of output, which wouldn’t be appropiate for things like my random photo. (Or my non-rotating photo formerly known as the random photo in the header. It’s on break right now.) My site is a pretty neat system of PHP includes, and I want to preserve that because it makes my life easy and doesn’t slow anything down any perceptable amount.

So I took the Staticize plugin and added support for dynamic non-cached sections, cleaned up the code a bit, fixed a weird problem where it would just show a blank page if it couldn’t write the file, fixed the problem with edit links and the comment form, and made it fit with the WordPress code a little smoother. Full instructions are included with the plugin, but to install just make sure your wp-content folder is writable (you may have already done that when setting up WP) and activate the plugin, and it will start working immediately.

I have a couple more improvements in mind for it already, but it’s fully functional and I’m running it right now.

Download Staticize Reloaded 2.0.

38 replies on “Staticize Reloaded”

Cool. I personally prefer plugins to includes, so I added a line to your code to allow me to exclude a function from the case as well as a include:

$store = preg_replace('|<!--fclude (.*?)-->(.*?)<!--/fclude-->|s', '<?php $1 ;?>', $buffer);

Then in my template I use the syntax:

<!--fclude heldomatic() -->
<?php heldomatic(); ?>

Seems to work.

WordPress Plugin: Staticize Update
Matt has updated the Staticize plugin that loads static pages for your visitors. If the content has changed then they get the updated version. This saves recourses and mySQL hits to your database. This version adds “support for dynamic non-cached se…

Well I suppose it could be easily modified to allow any PHP code, but because it’s included from inside a function every variable that was used would have to be explicitly global.

Staticize Reloaded
Matt has modified the Staticize plugin I wrote recently to allow for selective caching of PHP output, something I and most other people using my plugin have been looking for. More information is here.

WordPress Caching Plugin
The caching plugin I pointed to the other day was very well-executed but it didn’t meet my needs for several reasons, mainly that it cached every bit of output, which wouldn’t be appropiate for things like my random photo.

Should I should exclude the following items:
– Related posts plugin
– Google AdSense

As far as I can tell, all the trackback rdf info shows up as invalid for some reason when I use the plugin (and the original version of the plugin). I deactivate the plugin and all is well. I’m assuming there’s some snippet of code in the head somewhere that isn’t being cached/served and the rdf stuff depends on it somehow.

This is probably a php/fopen thang, but I noticed that if a parent directory is not world readable (even if +x), the script fails and says that it can’t create the temp files (although it creates the wp_content/cache dir just fine).

I am far from a php guru, but thought i’d mention that I had to chmod o+r all the way down my dir tree in order for this plugin to work (all previous plugins seemed to work okay before *shrug*).

Hrm. I’m running into a problem with the required include file (for blogrolls) being cached as well. The output isn’t updated unless a new comment or entry is added in WP and it should be dynamic.

In my index.php file I have a require in there pointing to my blogroll:

blogroll.php contents are simply:

Any ideas if I missed something or am doing something wrong? If I shut off the caching plugin, it updates properly.


Hrm. Code seems to have been stripped out of the above comment when surrounded by code tags. I’ll try again:

<?php require ‘includes/blogroll.php’; ?>

<?php wp_get_links(1); ?>

This is excellent, I must say. The benefits of static pages without the pain of republishing.

One issue however: it doesn’t appear to rebuild pages when a trackback comes in. I’ve tried this on a couple of WP installations, and it seems to be consistent in this.

I have a problem when using Staticize Reloaded plugin provided with the 2004.08.30 nightly build of WordPress. WordPress is installed into a different directory using this method: different address.

The “different address” hack works without the plugin activated. When activated, I have this error message:

Warning: main(/home/seanlong/www/wp//wp/wp-header.php): failed to open stream: No such file or directory in /home/seanlong/www/index.php on line 4

Warning: main(): Failed opening ‘/home/seanlong/www/wp//wp/wp-header.php’ for inclusion (include_path=’.:/usr/local/lib/php’) in /home/seanlong/www/index.php on line 4

Any ideas?

After installing it, everything seems cool, although my RSS feed doesn’t appear to refresh. Is there a workaround? I’ve checked in two different readers (Firefox live bookmars, and RSS Bandit). Since I activated the plugin neither has received anything new.

I found an important concurrency bug: if more than a client access to the same page, the same content could be appended several times to the same cache file.

It’s repeatable by using Apache Benchmark (ab).

Wp-Cache final

Ya puedo decir que el Wp-Cache tiene todas las caractersticas deseadas. Este ltimo cambio aade las capacidades de *cdigo no cacheado* de forma similar al Staticize Reloaded. Est programado de tal forma que si una pgina cacheada no tiene este ti…

WP-Cache 1.0 released

*Versin en castellano y otra.*

WP-Cache is extremely efficient WordPress hack –not a simple plugin– for page caching. It allows to serve hundred of times more pages per second, and to reduce the response time from several tenths of seconds to le…

This plugin has successfully turned my WP pages into gibberish 50% of the time. In Opera and Firefox both. Sometimes refreshing it fixes it, and sometimes it doesn’t.

Anyone else have this problem?

[…] La redazione (cioè io) si scusa con la gentile utenza per il disservizio che ha reso impossibile l’accesso a questo blog per quasi l’intera giornata. Per una volta la colpa non è stata completamente mia, purtroppo TopHost sta riscontrando non pochi problemi ai dischi. Da parte mia, c’era il plugin Staticize che murava completamente la navigazione. L’ho temporaneamente disabilitato. […]

No thanks, i think i’ll stay away from something that can wreak havoc and bust your set up just to save a few miliseconds of time that you can do easily by just trimming the fat off the site. Laziness can make more trouble than using a little effort.

Still, hope you guys finally work it out.

[…] Once the wordpress install is running you may wish to install caching  to reduce server load when your page gets alot of hits… that is if your a wishfull thinker like me.I have php5 installed on my server and had a hell of a time with wp-cache, every time I loaded a page that had not yet been cached I received a blank page untill I reloaded. I didnt figure out what the problem was but there where also problems with the multi blogging setup. So I decided to try staticize-reloaded which has less features but works right out of the box with this setup.. almost. Once it was installed I was dismayed to see the blank page bug again. After some searching I found that it was a problem with php5 and all that I had to do was replace ob_end_clean() with ob_end_flush() in the plugin file. […]

Comments are closed.