1 Blog Cacher 2.0
Update: the plugin zip contained a file (advanced-cache.php) with an error that prevented commenters from being cached individually. The error has been fixed and the correct zip uploaded. Sorry for any inconvenience.
The new version of this plugin has been released. New features:
- Use of WordPress advanced-cache. The plugin runs before WordPress is fully loaded (less execution time and specially less memory use).
- Management of HTTP headers, that are saved in .txt files after being conveniently modified, for full cached responses.
- Support for dynamic code (mfunc and mclude comments) as in Staticize Reloaded (and later in WP-Cache).
- If Gzip compression is enabled, compressed content is saved in .gz files so it's only compressed once (less execution time and less CPU use). If dynamic code is used, that code is run and only if the final content is different from the already saved it's compressed again for the response.
- If you have Gzip compression enabled and you are not using dynamic code, you can set the constant OBC_LOOK_FOR_DYNAMIC_CODE to false in order ro avoid this check.
- HTTP header 304 «not modified» returned when it's convenient (less loading time):
- If the plugin is going to return the same cache (from the same date) to a user, it returns a 304 header instead.
- Even with a different cache, if the content to return is the same (checked through a Etag header with a hash), a 304 header is also returned.
- When a post is created, modified or removed, the cache for that post and the index are removed for *all* users.
- (Logged) users and commenters management. Choose the plugin's behaviour for each group:
- Use no cache.
- Use a single global cache.
- Use an individual cache for each user.
- More configuration options:
- Option to cache or not error pages (status 404).
- Option to cache or not redirections (status 301 or 302).
- Option to omit url trailing slash («/«) in order to avoid caching the same content twice (don't use this in WordPress 2.3+ or if you are using a plugin that redirects urls with trailing slash).
- Option to save all files in the same directory.
- The plugin creates automatically a .htaccess file in the cache directory that forbids web access.
- Only «inconvenience» in this version: now the cache directory must be
/wp-cache/ (though it would be easy changing this in the code).
You can read the plugin full features or download it right away.
48 comments
#1. Agaponeo, 10 months and 14 days ago
The link for the downloadin zip is wrong...
Thanks for the plugin
#2. Javier García, 10 months and 14 days ago
Thanks. Changed the link.
#3. Habbie, 10 months and 13 days ago
The plugin only works for GET requests right now; many uptime monitoring tools send HEAD and therefore get a slow, uncached response. Adding HEAD to the check is completely safe to do.
#4. Javier García, 10 months and 13 days ago
Hello Habbie,
It's not so easy, as the HEAD response is different from the GET, but I'll work on it.
#5. arboltsef, 10 months and 6 days ago
Would this be an alternative for WP-Cache? I'd like to test it if it is.
#6. Javier García, 10 months and 6 days ago
Yes, of course it is.
#7. tapirul, 10 months and 3 days ago
one strange thing that happened after activating the plugin was that nobody could comment anymore. We would get a message something like «the comment could be spam and it was not saved» - did that even when I was trying to comment logged in as admin. The moment I deactivated the plugin everything worked fine again. Any ideas?
#8. Javier García, 10 months and 3 days ago
Are you using also 1 Blog Theme?. That message is returned by the antispam feature of our theme. 1 Blog Theme and 1 Blog Cacher can work together without problem (we use them together, as other many people). The only problem is that you set a cache expiration time longer than the expiration date of the timemark used by the antispam (1 day), which is something inusual.
#9. tapirul, 10 months and 3 days ago
yes, I am using the 1 Blog theme. I just let the default values. Where should I set the antispam feature of the theme?
#10. Javier García, 10 months and 3 days ago
The antispam filter is already setm you can find it in the theme-antispam.php file in case you want to disable it.
#11. tapirul, 10 months and 3 days ago
so it's a conlfict between cache's time and theme's antispam feature. How do I disable the theme's antispam feature?
#12. Javier García, 10 months and 3 days ago
> so it's a conlfict between cache's time and theme's antispam feature
If you haven't modified the parameters, not. Both work OK together.
> How do I disable the theme's antispam feature?
Simply empty the file theme-antispam.php
#13. tapirul, 10 months and 3 days ago
anyway, I find only now that the theme has an antispam feature. .. shouldn't something be included in the admin settings?
As I said, I had the default values both in the theme and the plugin, and couldn't comment anymore.
#14. tapirul, 10 months and 3 days ago
okay, thanks. Could you explain in more detail (or point to an explanation) how the antispam in the theme works? And what settings can be changed in the theme-antispam.php, to what effect? I think an antispam feature is great.
#15. Javier García, 10 months and 3 days ago
The antispam feature is automatic, and shouldn't cause any problems. It appears in the features list.
The antispam filter uses a time mark and a hash calculated with that mark. To get saved, a comment post must include a recent time mark (within 24 hours) and a valid hash for that mark. So it stops most of the automated spam without user intervention.
#16. tapirul, 10 months and 3 days ago
I think i understand, but in this case why it didn't work in my case? Since I was using the default values (timemarks, expiration times, etc)?
#17. Javier García, 10 months and 3 days ago
I don't know, that's why I sent you an email. Check your inbox.
#18. tapirul, 10 months and 3 days ago
didn't see it, sorry... Gmail are switching to a new «face» and the extensions don't work anymore (I am using gmail manager in my browser)... I had a bunch of other emails that didn't show up in Gmail Manager...
#19. Big Dog, 9 months and 20 days ago
I started using this but the stats show that 0 pages have been cached. Is there something that needs to be done to have it start (besides following the install instructions)?
#20. Javier García, 9 months and 19 days ago
If you are referring to onebigdog.net , the plugin isn't correctly installed there, as the comment the plugin adds doesn't appear. Make sure you followed all the installation steps. For instance make sure the plugin file is in the plugins directory, not in another subdirectory.
#21. Big Dog, 9 months and 19 days ago
This is shown on the options page:
Correct installation
The plugin has been correctly installed and cache files will be saved in the directory - /home/onebigdo/public_html/blog/wp-cache/.
#22. Javier García, 9 months and 19 days ago
Have you checked that the plugin file is where it's supposed to be (you haven't answered that)?. If so, then an error is occurring (it could be a misconfiguration), hence the plugin is not caching the files.
#23. Big Dog, 9 months and 19 days ago
Everything is where it is supposed to be. Perhaps one of the default settings needs to be changed...
I followed the directions to the letter so I am at a loss.
#24. bram, 9 months and 18 days ago
Hi, thanks for this plugin but I have problem with the installation.
I did everything based on the instructions, define('WP_CACHE', true); has been added to wp-config.php and I didn't change any value in advanced-cache.php. Got the following message on «Options > 1 Blog Cacher» page.
Installation error
The file - /home/fstw/public_html/wp-content/advanced-cache.php - is incorrect or you haven't added the code define('WP_CACHE', true); to the file /home/fstw/public_html/wp-config.php
If I comment the line 171 - 175 in 1blogcacher2.0.php then the page would looks like this: http://i10.tinypic.com/7208583.gif
Any idea? Could you give me some directive?
#25. Javier García, 9 months and 18 days ago
Make sure you have included the define along with the others, before the include call. And that the advanced-page.php file is the one included with the plugin. The error message says it all...
#26. bram, 9 months and 18 days ago
Finally
Yeah, define('WP_CACHE', true); has to be added before these two lines in wp-config.php:
define('ABSPATH', dirname(__FILE__).'/');
require_once(ABSPATH.'wp-settings.php');
Thanks again for this very nice plugin.
#27. Jack, 9 months and 14 days ago
everything works great in IE7 (thank you). unfortunately, i can not get it to work with firefox. is it compatible firefox or perhaps i'm missing something?
#28. Ollie, 9 months and 14 days ago
I tried to configure my wp-config.php file but keep on getting errors.
(«home/mysite etc./wp-config.php»): define('WP_CACHE', true);
I get Parse error: syntax error, unexpected ':'
And I have even chmod all files to 777 but to no avail!
#29. Javier García, 9 months and 14 days ago
Jack,
The plugin runs server-side, so it doesn't depend on the browser, of course cached pages can be view with Firefox (for instance I am).
Ollie,
The code to add doesn't include a «:», so it seems you arepasting an incorrect code. The line is ONLY this:
define('WP_CACHE', true);#30. Eric W., 9 months and 13 days ago
Now I have the problem, that my plugin 'live-search-popup' does display the search results as website into the result-box, instead of only showing the results. Take a look at: http://www.ericwagner.de and try typing (iron maiden) into the search box.
When the plugin is deactivated theres no such problem. I've excluded «search.php, live-search-popup, search_results.php» but that doesn't work.
Any idea?
#31. Javier García, 9 months and 13 days ago
Sorry, I don't know exactly how that search box works, but the plugin doesn't change the response, and in any case if you exclude the file that is called it shouldn't affect it at all.
#32. Gene Steinberg, 8 months and 30 days ago
This is a great variation on the WP-Cache theme. It seems to run faster.
Do you have suggestions or advice on using this with a polling plug-in, such as Democracy Poll?
Peace,
Gene Steinberg
#33. Javier García, 8 months and 30 days ago
If you want a certain part of the site not to be cached, you should use dynamic code (mfunc and mclude comments).
#34. Gene Steinberg, 8 months and 30 days ago
Well, it would be the poll, of course, but that would be part of every page, which would mean nothing would be cached, right? Also, I'm not sure how I would use «dynamic code,» since I don't speak PHP
Peace,
Gene
#35. Dario, 8 months and 27 days ago
Hi, this seems the long awaited continuation of wp-cache
It looks even better...what I'm asking is whether it is compatible or not to the popular wordpress plugin wp-postviews (a plugin that tracks readings of a post: http://www.lesterchan.net/portfolio/programming.php ) is compatible with your blog cacher. And if it is not by default (as I think), is there anything we can do to track postviews AND cache posts?
Thanks in advance for your great work,
Dario
#36. Javier García, 8 months and 27 days ago
Please, read a bit above: «If you want a certain part of the site not to be cached, you should use dynamic code (mfunc and mclude comments).»
#37. Dario, 8 months and 27 days ago
Yep, I already read that
the problem is wp-postviews is AUTOMATICALLY included as a plugin...what I'm asking you is not how to SHOW visits to posts (that would be easy with mclude etc etc...) but how to LOG visits using postviews! Once the file is cached and served from its html version, is wp-postviews called? Does it continue counting page loads or not? I'm not interested into showing it page counts to visitors, but want to understand whether it functions or not!!! thanks a lot for your speedy answer 
#38. Javier García, 8 months and 27 days ago
It's exactly the same, you need to «uncache» the part where the plugin logs visits with dynamic code. If you don't know how to do that, sorry, but this is a blog about the plugin, not a free support site.
#39. Dario, 8 months and 27 days ago
Never thought it was a free support site, sorry if I made you think that!
wp-postviews is a rather common plugin and I thought explicitly making 1blog cacher caompatible with it might have been a nice thing. I'll code a solution and post it here for your readers once I'll find one if you want
Thanks and have a nice day
#40. DarK SouL, 8 months and 3 days ago
I am wondering, if I use this plugin, will StatTraq still be able to count the visitors?
#41. Javier García, 8 months and 3 days ago
Not directly, the whole point of the plugin is not having to load WordPress over and over again. Though you can adapt the plugin to work with dynamic code. In any case you should use another solution, with that plugin you are only getting bad reports while overloading your database. You should use an external solution like Google Analytics.
#42. DarK SouL, 8 months and 3 days ago
Thought so, I just ditched it anyway and went with Google Analytics, StatTraq was bloating my database in a painful way.
By the way, your plugin is awesome, I tried to use wp super cache but it wouldn't do anything, yours worked «right out of the box».
#43. shashank, 5 months and 18 days ago
Hi. For analytics, use google analytics. Don't bother with useless statpress etc.
For search, just use google custom search, it searches through everything on your site including comments etc, sorts them by relevance, and highlights keywords.
And yes 1Blogcacher is coming out nicer in my experience than wp super cache. Well done! And pls continue to maintain it..
#44. Penelope @ Our Fourpence Worth, 4 months and 9 days ago
Hi Javier,
Thanks for the great plug-in. I've been using it for a while and have been pleased with it. But I wanted to let you know that ever since upgrading to WP 2.5 and 2.5.1, this plug-in has been causing the «Preview Post» to not work. I just discovered that I had to deactivate 1 Blog Cacher in order to preview my posts when writing. (It worked fine before the upgrade to 2.5).
Thanks again,
Penelope
#45. Javier García, 4 months and 9 days ago
I'll look into it, though you just can simply add any paremeter of the preview url to the strings not to be cached.
#46. polio, 4 months and 1 day ago
hi, I love this plugin, but it cannot run very good in wp 2.5 and 2.5.1,
when I login as admin, I can not see the [edit] link in the web page, but I really loged in,
after I turn off the plugin, It works again, not knowing why
#47. polio, 4 months and 1 day ago
some people say the wp 2.5 change some cookies funtion... maybe you can try to do some fix on that
#48. Javier García, 4 months and 1 day ago
Fixed.
Write a comment
If you want to add your comment on this post, simply fill out the next form:
* Required fields
You can use these XHTML tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>.
1 trackback
To notify a mention on this post in your blog, enable automated notification (Options > Discussion in WordPress) or specify this trackback url: http://1blogcacher.com/2007/09/1-blog-cacher-2-0.html/trackback