Staticize 2.5

Version 2.5 of the Staticize Reloaded plugin is now available for download. Installation instructions are included in the archive. What does Staticize Reloaded do? It is a highly advanced caching engine that dynamically and automatically caches pages on your site that need to be cached, when they need to be cached. It also allows for some parts of a page to be cached and others not to be, so for example your menu could always be dynamically included from a single file while your main blog content was cached. With Staticize Reloaded you don’t have to worry about rebuilding, stale caches, slow posting times, or any of that. It works silently, efficiently, and trasparently to both the end user and the author.

This version adds the ability to have dynamic functions on a page in addition to dynamic includes. It also adds full support for etags and last modified headers, though you must turn it on in the plugin file. My one tip is that when you redesign or tweak your template temporarily deactivate the plugin. Staticize Reloaded is well-suited for sites on older servers or that receive more than twenty thousand visitors per day. WordPress is so fast anyway I find it’s not worth caching on lower-traffic sites.

Update: The zip archive had a slightly older version of the plugin than the final 2.5 release. Please re-download to get the latest and greatest and fastest.

51 thoughts on “Staticize 2.5

  1. I’ve tried using both this, the latest, and the earlier versions, and they all come up with a variety of errors. On IE I sometimes get asked if I want to download a HTML file. On Firefox (though not consistently), the output is entirely garbled.

    Anyone else have these problems?

  2. Matt: I already tried that, didn’t seem to do much good. Hmm. Maybe I didn’t uncheck it until after I had turned on the plugin, that would screw it up, right? Let me just try again.

  3. Pingback: Fragments
  4. Definitely improved over 2.0!

    One problem, though: something seems to be wrong in the timer code when run under WP 1.2. I was getting results like this:

    Dynamic Page Served (once) in 0.427 seconds
    Static Page Served in 1,090,948,038.645 seconds

    Of course it doesn’t really take that long — $timestart just isn’t being set when it’s loaded from the cache.

    To work around this, I’ve added the following to the beginning of staticize-reloaded.php:
    if (!isset($timestart)) { timer_start(); }

    I’ve also found it useful to have a few files that aren’t cached, so I’ve added a $skipFiles array similar to $acceptableFiles. (I did this under 2.0 but never got around to suggesting it.)

  5. Michael: That would be your-wordpress-folder/wp-content/staticize-cache

    It will be full of .php files created by staticize, and if they were created while gzip output was turned on, they will actually contain gzipped data instead of HTML and PHP. If you delete those files, Staticize will recreate them, and if you’ve disabled gzipping it will create them with the raw page content, which is what it expects when it reads from the cache.

  6. Michael – Check the owner and access rights of the directory your trying to delete. If you’re not the owner, then your server software probably owns the directory. If the owner is ‘apache’ or ‘nobody’ then this is the case. Odds are you don’t have access rights to change the owner, so write a short php script to delete the directory. When your server executes the script, it should be able to delete it.

  7. Whenever a comment is left, or a post is edited or posted etc the cache is flushed. You shouldn’t have to worry about the directory.

  8. I love this plugin, it makes wordpress run much faster for me.

    However, I too am experiencing the same problem as Michael mentions, not being able to delete any of the files in the cache. And indeed I do not have root access to my server. That PHP script you mention, Mike M, would you be able to write such a script? Unfortunately, my PHP skillz are limited to “include, if, else”.

    Thanks.

  9. I’ve found a way of keeping dynamic page on a cached page. Easy peasy. Use an iframe. Most modern browsers won’t mind a static iframe, just align it and size it like you would and image or a paragraph. Works perfectly for my random Googlism line at the top of my blog

  10. Pingback: 8 Ways to Sunday
  11. Pingback: Aldoblog
  12. Saved my site! Had serious ‘DOS attack’ due to a ref to CHAITGEAR on slashdot, and after the couple of hours it took to figure out what was going on, I got Staticize, tweaked my (aging) code to use it, and I’m back up and running! For the moment, it’s a lifesaver. Thanks Matt!

    -d

  13. Matt… Shocked to realize that STATICIZE 2.0 is throwing out static copies of admin pages too! Please help!
    I tried to update it using STATICIZE 2.5 but that’s causing my APACHE to crash… and then my OPERA craches..

    Matt, I’m actually trying to use staticize reloaded 2.0 with multiblog environment…. for now, I’m running it on my local winxp-Apache-mysql-php evnironment. What I;ve done is.. I’m using M as base installation. I have a folder S inside M that contains files that require all required files from another copy of M that’s in SE folder inside M…. this way, I’ve created a common file structure that all blogs such as S1, S2, S3 etc will use. I have a wp-admin,index.php,wp-config.php etc in each of S1, S2, S3 … all these use separate databases. All required files are in SE folder and all S1, S2, S3 copies have corresponding filenames that REQUIRE corresponding files from SE folder. This way, it saves a lot of space and time.. moreover, I have a common template for all Sn stored in SE folder. All plugins are inside SE/wp-content/plugins and their common cache for all Sns is stored in SE/wp-content/cache folder.

    Right now, all blogs are working just fine and all admins are separately accessible with their separate databases. BUT NOW THE PROBLEM COMES AS SOON AS I ACTIVATE STATICIZE RELOADED! Matt, as soon as I activate this, I get 2 problems :

    1. I’m not able to log into admins of any Sns. the wp-login throws me to the same localhost/M/S1/wp-login.php ( but I find STATICIZE RELOADED STARTS FUNCTIONING..( remember S1 will be a subdomain when I upload everything to my real web server ).

    Now if comment this blog in wp-settings of SE,

    if (!strstr($_SERVER['PHP_SELF'], 'proent/plugins.php') && get_settings('active_plugins')) {
    $current_plugins = explode("\n", (get_settings('active_plugins')));
    foreach ($current_plugins as $plugin) {
    if (file_exists(ABSPATH . 'conT/plugins/' . $plugin))
    include(ABSPATH . 'conT/plugins/' . $plugin);
    }
    }

    then I find I can log in to any Sn’s admin. I have to comment this and then I log in to any blogs admin to deactivate staticize reloaded. Once I do it, and log off and uncomment this block and relogin, I can log in now! ( when STATICIZE RELOADED IS DEACTIVATED )

    2. STATICIZE RELOADED IS CREATING CACHE PAGES FOR ADMIN PAGES TOO.. I have a blog on iworld.proweblog.com and I’ve been using your 2.0 plugin for more than 3 months now and I realize it’s not creating caches for admin pages… but I don’t know why its creating caches for admin pages here when each Sn blog uses SE copy of required files and the cache getting stored in common cache folder in SE.

    So for now, I need 2 things solved :
    1. It should not create static copy of admin pages of each blog.
    2. It should allow me to log in to any Sn blog’s admin while its ACTIAVED.

    So, can you shed some light on this Matt? I hope you’ve understood what I’m trying to do! I’m asking this straight from the very creator of this Plugin and truly hope to get a real solution from you.

    Thanks in advance Matt.
    My true best regards,
    Vishal.

  14. Pardon me… all Sns are stored inside folder M . This way, when I shift the whole set to my web site, I’ll have M as http://www.M.com as the main site, and then all Sns will be on subdomains, that is, S1.M.com, S2.M.com etc…..
    Thanks.

  15. I can only guess it’s because of your very unique setup that you’re seeing problems, as something like this would be more widely reported otherwise. Sorry!

  16. Staticize isn’t playing nicely with a particular, admittedly strange, configuration I have.

    I have a PHP function (and some supporting functions) to generate and interpret some forms dressed up as a plugin so that I can call it from a post using RunPHP. With Staticize turned on, the output doesn’t get updated. Even adding “?staticize-flush=TRUE” to the form action doesn’t do it.

    The real problem is that I can’t define the functions in my “plugin” to be dynamic using the directives, because then the plugin manager blows up with all kinds of “header include” errors. I also can’t do it in my post because the inlined PHP gets eval’d.

    Any suggestions?

    Oh, a nice feature for 3.0 that would help me out a ton here is an admin panel that allowed you to specify functions to be considered dynamic, instead of having to use the directives.

  17. Yes, but I don’t understand quite what you mean. I’m trying with an <!–mfunc–> comment in the actual post now, but will that cause of the functions called by that function to also be dynamic? Something’s wrong, because the permalinks get screwed up in the form action.

  18. OK, I pulled my code out into a separate file (abandoning RunPHP), and include it in my template via an <–mclude–> tag. Everything seems fine except that a call to get_permalink() returns a permalink to today instead of to the page or post. The code gets called within The Loop, so I don’t understand what’s going on. This only happens when Staticize is turned on, and zapping the cache fixes it one time, but then the next reload sees it screwed up again.

  19. Yes it works under WP 2.0! Nevertheless I regret to tell you that I suffer the same trouble as post #30 above, which alerts of a “no-login” situation arising from having this plugin activated. I am experiencing the same problem, although my setup is much less convoluted than Vishal’s. I have access to my dashboard thru links on my own posts, but not thru the login page.

    It seems I have to choose between this plugin and access to the wp-login page. Mmhhh…

  20. Strange, really – as with WP Cache 2.0, I run into the same problem: The encoding is messed up for some reason, special characters are not displayed properly, but goes back to normal, when I turn off the plugin.

SHARE YOUR THOUGHTS