WordPress

Майстер класи WordPress

DB Cache plugin

The fastest cache engine for WordPress, that produces cache of database queries with easy configuration.

Description

This plugin caches every database query with given lifetime. It is much faster than other html caching plugins and uses less disk space for caching.

I think you’ve heard of WP-Cache or WP Super Cache, they are both top plugins for WordPress, which make your site faster and responsive. Forget about them – with DB Cache your site will work much faster and will use less disk space for cached files. Your visitors will always get actual information in sidebars and server CPU loads will be as low as posible.

See the DB Cache homepage for further information.

Installation

1. You should upload the db-cache folder to your wp-content/plugins
2. Go to your Plugins page and activate “DB Cache”
3. Now go to Settings->DB Cache and enable caching of DB queries. The plugin will create wp-content/tmp folder and db.php file for serving cached queries in wp-content folder.

That’s all! Enjoy the speed of loading pages.

Frequently Asked Questions

How do I know my blog is being cached?

Check your cache directory wp-content/tmp/ for cache files.

How can I ensure of reducing server usage?

View the source of your site page, there maybe some code like this at the foot:

<!– 00 queries. 00 seconds. –>

If not, please put these codes in your footer template:

<!– <?php echo get_num_queries(); ?> queries. <?php timer_stop(1); ?> seconds. –>

After using the DB Cache, I think you’ll find the number of ‘queries’ reducing a lot.

Why is DB Cache better than WP Super Cache?

This plugin is based on a fundamentally different principle of caching queries to database instead of full pages, which optimizes WordPress from the very beginning and uses less disk space for cache files because it saves only useful information.
It saves information separately and also caches hidden requests to database.

Troubleshooting

Make sure wp-content is writeable by the web server. If not you’ll need to chmod wp-content folder for writing and also config.ini file in plugin folder.

How do I uninstall DB Cache?

1. Disable it at Settings->DB Cache page. The plugin will automatically delete all cache files.
2. Deactivate it at plugins page.

Other Notes

Updates

Updates to the plugin will be posted here and the Ukrainian WordPress will always link to the newest version.

Thanks

I would like to thank Lviv for giving me the idea for this and RKG for support.

Download

Download DB Cache Version 0.6

Downloaded a total of 5172 times


404 Responses to “DB Cache plugin”

  1. Мое мнение о кэширование в Wordpress » Статьи » Темы и Плагины для Wordpress says:

    [...] моя правда и мои выводы. После тестирования плагинов db-cache,  cos-html-cache и подобных, пришел к такому выводу. Если у [...]

  2. William says:

    Thank you for the plugin… I’m using WP-Tuner, and it causes an error, reporting that WPDB is already loaded and the site is not loaded, either the admin or front pages.

    When I disable either DB Cache or WP-Tuner, it starts to work again. Is this a known issue?

    • Dmitry Svarytsevych says:

      None, I didn’t knew this. It will be checked

    • Oliver says:

      Hi,
      i have the same Problem as William says

      “I’m using WP-Tuner, and it causes an error, reporting that WPDB is already loaded and the site is not loaded, either the admin or front pages.”

      Best wishes
      Oliver

  3. MArcos says:

    Why dont integrate db-cache with wp-super-cache???

    in the future??

  4. mrbabqc says:

    Hi, this caching plugin looks very good. But can it be use with multiple templates active on a site ? that is with themes switcher feature enable ? In that case will it be efficient ?

    TIA for a feedback

    • Dmitry Svarytsevych says:

      I’ll check this. Plugin doesn’t caches full html – only needed information (configuration options etc.)

  5. connect says:

    Dmitry,

    Your plugin – DB-Cache – is getting much attention and it appears to be generating many comments.

    I would like to say that your efforts are very much appreciated, as is, of course, the plugin.

    Hang in, and keep up the great work.

    Thanks a bunch!

  6. I-MAN says:

    yes as connect said. its a great plugin, hang in there, since there is alot of work asked by people.

    ok i had a question.

    before db cache i used wp super cache and widget cache.

    http://www.mashget.com/2008/09/01/wp-widget-cache-for-wordpress/

    now i deleted super cache.
    but my widget cache is still installed, do i still need that.

    thanks

  7. Tony says:

    I liked being able to choose what tables to cache, now that I can’t its playing havoc with my Text Link Ads plugin.

    • Dmitry Svarytsevych says:

      What tables you would like to cache or not?
      I’ve made some experiments and decided don’t to cache wp_posts and wp_postmeta tables

  8. azz says:

    Just For A Feedback

    My Hosting & Wordpress Setup:

    WordPress 2.3.3 <- It’s Working :-)
    Apache 1.3.41
    MySQL 5.0.51a
    DB Cache 0.5
    Average User Visit Per Day: 800++

    My Result:

    Plugin working so well, no problem at all, thank you very very much for your superb plugin.

    List Of Install Plugin (active):

    01) Advanced-Admin-Menus 2.2.1
    02) AJAX Calendar 2.4.6
    03) Dashboard Lite 0.3
    04) Download Counter 1.2
    05) Easy Gravatars 1.2
    06) Excerpt Editor 1.0
    07) Google XML Sitemaps 3.1.2
    08) HeadSpace2 3.4.1
    09) ImageManager 2.4.1
    10) Link to Me Textbox 1.0
    11) MobilePress 1.0.3
    12) NextGEN Gallery 0.96
    13) Page Restriction Plugin 1.5
    14) Pierre’s Wordspew 3.73
    15) Similar Posts 2.6.2.0 + Post-Plugin Library 2.6.2.1
    16) Wordpress Thread Comment 1.4.9.2
    17) wordTube 1.53
    18) WP-CopyProtect 1.5
    19) WP-Directory 1.1
    20) WP-UserLogin Widget 2.2
    21) WP-UserOnline 2.20 + WP-UserOnline Widget 2.20

  9. Hackpat says:

    this plugin run on my wp 2.7 (www.losportables.com.ar), it´s very good!

    one question:

    why the plugin not use cache? or gzip¡?

    example Index

    db-cache off / wp-super cache on:

    example Index

    db-cache ON / wp-super cache off

    • Dmitry Svarytsevych says:

      I’m sorry but I didn’t understood you comment.

      Db cache is plugin for caching queries to database.

  10. Hackpat says:

    The plugin is very good.

    Failure to add a cache system or thah supports same WP-cache or súper cache

    Whith my web wp-super cache on, load master, but generate SQL Request more

    My site with you load plugin, Slower, but generate less querries

    Perfect your plugin function an make compress Gzip o combine wit WP-cache

    THEN BE THE MOST FAMOUS FOR WORDPRESS PLUGIN

    SORRY MY ENGLISH IS BAD

    • I-MAN says:

      i think he mean,

      he want to use wp super cache (because it caches the whole page rather then just quries) with db cache (which catches quries only)
      and also gzip.

      he wants this plugin to cache the whole page too with quries and have an option to eneble gzip.

      there is a plugin called Gzippy which enables gziping.

  11. Paul Grill says:

    first of all thank you for this great plugin, your approach looks better because it supports dynamic pages.

    however, i have one question: Is there a way to prevent certain DB queries from being cached? To make an example, I made an interface allowing my visitors to make changes to newsletter subscriptions. So when a user makes a change, the cache still holds the old information. Any way of solving this?

    • John says:

      I have this same issue with simple press forum. The forum will not show posts if they are cached until the cache is cleared.

    • Dmitry Svarytsevych says:

      In new, 0.6 version I’ve added filter field, so now you can choose what typ of queries to cache

      • Heu says:

        Hi!
        i’ve checked new filtering feature, it’s work perfectly with Quotes Collection plugin, but i’ll very happy if we have a flag for make a query which skip the cache engine, something like that:

        $result = $wpdb->get_row($sql, ARRAY_A, NO_CACHE);

        i think it’ll have more flexible!

  12. I-MAN says:

    alright my hosting fired me, Was kicked out of the hosting for the first time.

    they said that recently my site maked a lot of server load increase.

    so i thought this plugin was suppose to lower the loads, not increase.

    where is the problem so it can be fixed?

    • Dmitry Svarytsevych says:

      Please send me your list of plugins. We’ve noticed an incompability with DB Backup plugin

      • I-MAN says:

        alright these were plugins i was using before i was kicked,

        Comment Form Quicktags 1.0
        Comment Reply Notification 1.1
        Executable PHP widget 1.1
        Faster Smilies 1.0
        FD Feedburner Plugin 1.4
        Google XML Sitemaps 3.1.2
        Math Comment Spam Protection 2.2
        Platinum SEO Pack 1.2.3
        Post Tabs 2.7
        Quote Comments 1.2
        Sidebar Login 2.1.4
        Sociable 3.0.2
        WordPress.com Stats 1.3.5
        WP-CommentNavi 1.00
        WP-PageNavi 2.40
        WP-PostViews 1.40
        WP Security Scan 2.3
        db cache 0.5
        WP to Twitter 1.2.6
        WP Widget Cache 0.25.1
        WP Global Translator – NOT using not (was using)

        now just changed the db cache to wp super cache again.

        untill i get the cleanist idea that it was not the reason of server load increase. i cant take chance.

        by the way, what exatly are 0.6 improvements.

  13. Titanas says:

    Great plugin but i was wondering what’s the difference between MySQL doing caching and your plugin. Can i run both?

  14. Dmitry Svarytsevych says:

    Please heck the new version 0.6!

  15. I-MAN says:

    hello there, i just installed the db cache 0.6, and its not caching queries.

    0 cached queries

  16. iacchi says:

    Actually, I have a server load increase too; about 40% even if it is not a problem for me. I think this is just the other side of the medal.

  17. Tony says:

    Whats the best setting for “Expire a cached query after”

    • Dmitry Svarytsevych says:

      I’ve setted it to 10-15 minutes

    • Вячеслав Сенников says:

      Да таков наш современный мир и боюсь наверное с этим ни чего невозможно поделать:)

  18. John says:

    It appears version .6 resolved my issues. I put all of the simple press forum tables in your cache filter since I have no idea which ones can be cached, if any.

    So far, the forum works and my pagenavi works. Have not noticed any other issues.

    Sites seem quite a bit faster.

    Thanks a lot.

  19. WordPress Plugin Releases for 01/12 | Web2.0 says:

    [...] DB Cache [...]

  20. Heu says:

    Do you have a plan for using memcached with your plugins? as i known, they work very closed and we’ll take advantage about performance and scalability!

  21. Raul says:

    After some tests, I believe this plugin has serious security issues.

    Don’t take me wrong, but I’m trying to help here!

    1 – First of all, the users table, should never be cached as it contains all users details and passwords (encrypted, but hackeable).

    2 – Having the tmp folder public is a serious security issue. There aren’t even any index.html files created, in order to prevent cache files listing (although we can block file listing with htaccess files). Either you make it more secure storing files outside the domain, or you make sure index.html files exist in each directory created.

    3 – Despite the fact this plugin reduces mysql queries (a lot), it will increase the server load, and also the overall page load. If you run your mysql server on the same machine, it will just transfer the load on mysql to apache. Still, it should be a great asset, if you run mysql on another machine and have a powerfull web server (like dreamhost PS, mediatemple, etc).

    The loading time is also increased due to the unserialize function, wich is slow, even on faster machines. (php.net).
    Also if you have a slow Hard Drive on the web server, or if it is under a big load, it will take a while to read the cached files. Keep in mind, that having 100 articles is ok, bt in my case I have about 50.000 posts, and so writing/reading so many cached files, will eventually slow down the whole system…

    4 – This brings me back to my sugestion…

    Perhaps the best thing you can do, is to cache the whole thing on another mysql temporary table, as in most of the times the mysql performs far way better (specialy on other machine) that files, and it’s more secure.

    I went from 66 queries to 3 queries, and still my pageload went down just a few ms.

    My guess is that having to do an extra query for retriving the cache, will be a fair price for this plugin.
    It’s faster to make 4 queries, than to do 3 queries + /searching/opening a files, unserialize it and output the results…

    At first you might try to keep things serialized, but stored on DB.
    Then you might want to eliminate the serialize/unserialize thing.

    This way, we might have the perfect pluging for dynamic wordpress sites, that scale well enough to be used on large sites.

    Keep up the good work.

  22. I-MAN says:

    Very Very Nice analysing Raul.

    could you please check this one too, its also a cache plugin.

    http://www.satollo.com/english/wordpress/hyper-cache

    i want to know if that one slow the server too.

    oh and please admin dont take this as a spam, just trying to find out what is best for my website.

  23. Wordpress DB Cache Plugin says:

    [...]

  24. Paul Grill says:

    Thanks for .6, it fixes the issue mentioned earlier.
    It would be even better if db-cache could keep track of UPDATEs instead of clearing the entire cache all the time.

    Possible bottlenecks of db-cache might be:
    - The usage of serialize+unserialize. You should consider using var_export for storing and a simple include() for importing
    - Storing queries one per file. 13 cached queries mean 13 files that need to be retrieved and opened. Maybe you should group queries by the REQUEST_URI ?

Leave a Reply