WordPress.org

Ready to get started?Download WordPress

Forums

WP Super Cache
Need for a clarification with Supercache, please ? (5 posts)

  1. sabinou
    Member
    Posted 3 years ago #

    Hello, I'm trying to find a way to prevent supercache from caching a <?php random_posts(); ?> function call in my sidebar.
    With hope to make the plugin cache pages that would still call the php plugin once a visitor calls them).

    In this regard, I have noticed a section of the plugin's "readme" file... However, to be frank, I am not sure I properly understood it :(

    In http://wordpress.org/extend/plugins/wp-super-cache/faq/ , in the "
    How do I make certain parts of the page stay dynamic?" section, there is this introduction :
    « WP Super Cache retains the dynamic loading code of WP Cache but only works in legacy caching mode. »

    Does that mean we can exclude some code to be cached only in Legacy caching mode ?
    If so, since I'm using mode_rewrite, would that mean it's impossible to avoid caching the output of my <?php random_posts(); ?> call ?

    Thank you very much if you can answer me, I'll be grateful !

  2. Donncha O Caoimh
    Member
    Plugin Author

    Posted 3 years ago #

    You need to use legacy caching mode. It works very well but you can't cache quite as many files as with the other modes because of the way it works.See if you can convert the dynamic part of your page to Javascript first!

  3. sabinou
    Member
    Posted 3 years ago #

    I guess I'll have to try the legacy caching mode, then !

    Thank you very much for all your time and help, Donncha, I'm very grateful :)

  4. sabinou
    Member
    Posted 3 years ago #

    Haha, it's interesting !
    I had not planned to make a new response, and yet, here I am. I don't know if I must call this a bug report, a call for help (after all, in the end, "it works" !), or an experience report. Donncha, if the situation interests you and you want me to beta-test, free free to ask, otherwise, I'll let my situation as is ("it works", that's what matters.)

    -

    I had unavoidable T_String errors with Legacy mode and this code addition in my sidebar (with the growing old Andreas theme, not the revised version of october 2010) :
    <!--dynamic-cached-content--><?php
    random_posts();
    ?><!--
    random_posts();
    --><!--/dynamic-cached-content-->

    With zip compression ON, it was another error message, but turning it off didn't solve the problem.

    So, I switched back from Legacy to Mod_rewrite

    And, unexpectedly, the random post function STILL works ! I double-checked, even with a browser that has never been used to log into my blog, even with the footer source code indicating a cached page is served, the random_posts function is actually called afresh every time !

    In the end, "it works", I suppose this is the most important thing, when it comes to that.

  5. Donncha O Caoimh
    Member
    Plugin Author

    Posted 3 years ago #

    I doubt it's caching if the random post is changing. You're best bet is probably using javascript, and if you're really worried about performance you'll have to provide some sort of caching in the random post function too.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic