Support » Plugins and Hacks » So how do you use cached data??

So how do you use cached data??

  • I’ve got some code running on my site, fetching data using wpdb->get_results(). In the Codex it seems like every Wpdb function caches its data, but I can’t find anything on how to USE this cached data!! I’ve searched high and low but cannot find anything.

Viewing 7 replies - 1 through 7 (of 7 total)
  • I think it just sits there …..
    You know how to remove the cache if you need to ?

    It can’t just sit there, it has to be retrievable somehow, otherwise it’d be “wasted”, not “cached”.

    I’ve just opened up some random cache files, unfortunately I haven’t come across anything resembling my queries; it seems like all the files are for are saving settings and parameters… although I did find the dashboard cache file, which is weighing in at over 180kb

    Podz: “I think it just sits there …..”

    A cache area is where static pages (including graphics) are stored for immediate access instead of repeating a dynamic downloading process each time the same page is visited during a given period of time. I cannot even think that WP’s cache just sits there. Of course some means to clear the cache is desirable for testing purposes or whatever (including lack of enough disc space), but disabling the cache for no reason is a bad idea unless WP do not use it. In such a case I agree with egarcia, it’s just a resource ‘waste’ not a ‘cache’.

    Hmmm. I didn’t think generic getresults on wpdb were cached, I thought it was specific tables and data — at least, for the 2.0 object-caching system. I could be wrong.

    And for WP-Cache, that caches on a page-level, so would cache a given accessed url but not a particular query itself.


    stopthepress – it also causes problems (try looking at the Comments tag category here) and on your average blog the possible benefit of having a cache is negligible.

    Upon reading the wpdb Class page over and over, I think I understood wrong before. It seems the “caching” it refers to is only within the class itself, not to a data file on the server. The data from the query is “cached” for use elsewhere in the same page during the same page request.

    I think now that WP2 has page caching, the codex might need some rewriting to better differentiate between query caching and page caching.

    From what I understand, WP2 does ‘object caching’, of particular frequent-accessed tables. Like options, or users. And when I ‘caching’ I mean to a file on disk, to speed up frequent requests for the same data.

    To the best of my knowledge, WP2 does not do generic query caching (which mySQL can be set up to do, if you run your own server), nor does it do request-level caching (which you can get using the WP-Cache plugin, a derivative of the original Staticize Reloaded hack).


Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘So how do you use cached data??’ is closed to new replies.
Skip to toolbar