WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: W3 Total Cache] Works with dynamic content? (28 posts)

  1. kjetilgf
    Member
    Posted 4 years ago #

    Hi
    Will this plugin work with dynamic content (like random images, random posts)?
    Of course it is a contradiction between dynamic content and caching. I've skipped WP Super cache because it is said to "freeze" the displayed content. (Nothing bad said about that plugin, there is a reason why it is so popular :o)
    Thanks,
    Kjetil

    http://wordpress.org/extend/plugins/w3-total-cache/

  2. Frederick Townes
    Member
    Posted 4 years ago #

    There are hooks to allow WP Super Cache to not cache static components in your theme. W3TC on the other hand will cache the output of WP, to make your site more dynamic you can either:

    • use javascript
    • lower the expiry time of your pages
    • exclude some pages from being cached entirely
  3. LAEM
    Member
    Posted 4 years ago #

    Thanks Frederick - could you tell me if your plugin deletes the cache on updating of a post, or submission of a new comment?

    many thanks.

  4. Frederick Townes
    Member
    Posted 4 years ago #

    Yes, all of the events that modify posts (creation, editing, comments etc) all invalidate the cache.

  5. LAEM
    Member
    Posted 4 years ago #

    Thanks Frederick.

  6. Cristian
    Member
    Posted 4 years ago #

    I have the same problem where a section on my sites displays dynamic content that changes on every page refresh.

    It would be great if W3TC also had similar hooks like WP Super Cache to not cache the output of a certain function just like you can tell W3TC to not cache the query for a certain database table.

    Many people including myself use WP as a CMS to build all sort of different sites and not just blogs.

    It would be fantastic if this functionality could be implemented in W3TC as that way I could use W3TC on all my other sites built on WP.

    Thank you for your hard work on this awesome cache plugin.

  7. Frederick Townes
    Member
    Posted 4 years ago #

    I know. This feature has already been scheduled for a future release.

  8. Cristian
    Member
    Posted 4 years ago #

    Hi Frederick,

    It would be great to have hooks to allow W3TC to not cache static components.
    Will this feature be released in the next version of W3TC?

    Thanks.
    Cristian

  9. Frederick Townes
    Member
    Posted 4 years ago #

    Yes.

  10. fruitllama
    Member
    Posted 4 years ago #

    Absolutely dying for this feature.

    This, with the existing code will kill all the other cache plugins.

  11. Frederick Townes
    Member
    Posted 4 years ago #

    Trust me, there are even better features in the road map.

  12. chen
    Member
    Posted 4 years ago #

    hello, nice plugin! is this feature already in the latest version? because we're planning to change our caching plugin, only if we can make some parts/content of the page dynamic.. like rotating banner or images?

    thanks! :)

  13. fruitllama
    Member
    Posted 4 years ago #

    Yes please.

    Is this feature available in ver 0.9?

    How do we enable it?

    Where can we find instructions on configuration?

    Peace be with you.

    |_|

  14. Frederick Townes
    Member
    Posted 4 years ago #

    The development version is available here: http://wordpress.org/extend/plugins/w3-total-cache/download/ and the FAQ contains instructions on fragment caching options.

  15. fruitllama
    Member
    Posted 4 years ago #

    Frederick, can't seem to find the instructions for fragment caching in the 0.9 FAQ.

    I've also replied to a support ticket email from this morning.

    Thanks.

  16. Frederick Townes
    Member
    Posted 4 years ago #

    Here are some examples:

    Example 1:
    <!-- mfunc any PHP code --><!-- /mfunc -->

    Example 2:
    <!-- mfunc -->any PHP code<!-- /mfunc -->

    Example 3:
    <!-- mclude path/to/file.php --><!-- /mclude -->

    Example 4:
    <!-- mclude -->path/to/file.php<!-- /mclude -->

    Also spaces can be used and letters in any case:

    Example 5:
    <!--MFUNC -->
    echo rand();
    <!--/mfunc -->

  17. centepines
    Member
    Posted 4 years ago #

    Hi Frederick
    this seems cool, but I cannot implement it - it will make my page go blank if a put <!--MFUNC -->
    php code
    <!--/mfunc -->

    Do I need to have installed WP Super Cache? I'm really confused!

    thanks

  18. Frederick Townes
    Member
    Posted 4 years ago #

    Have you contacted me by email about this? It's hard to track people using the forums.

  19. LocaOH
    Member
    Posted 4 years ago #

    I'm having the same exact problem: blank pages, when trying to use <!-- mfunc -->any PHP code<!-- /mfunc --> (or any other variant)

    W3TC version: development 0.9

    I thought this would change when I moved servers (I did change my hosting last night) but it keeps happening.

    Apache version 2.2.15
    PHP version 5.2.13

    (just in case ;)

  20. Frederick Townes
    Member
    Posted 4 years ago #

    Only independent code that doesn't depend WP functions can be called in fragment caching because this code is executed before most of WordPress core is unavailable.

  21. ArcadeBB
    Member
    Posted 4 years ago #

    WP functions such as $post->ID ?

    Basically I am tracking the incoming traffic using a file called in.php. I used the W3TC Development version and in the first line of the theme header.php, I use

    <!--mclude in.php-->
    <?php include_once(ABSPATH.'in.php');?>
    <!--/mclude-->

    I did call for $post->ID in the in.php file which according to your reason could be the reason that the site went blank.

    I will tried to remove the $post->ID and see if it works.

  22. ArcadeBB
    Member
    Posted 4 years ago #

    No, it is still a blank page.

    I am using W3TC Development Version 0.9
    WordPress: 3.0
    Page Cache: Enabled
    Page Cache Method: Disk (basic)

    Even a in.php with just <?php ?> also show a blank site

  23. ArcadeBB
    Member
    Posted 4 years ago #

    it works if I echo something instead of <?php ?>

    <?php
    echo "hello";
    ?>

    So there is hope.

    W3TC : Development Version 0.9
    WordPress: 3.0
    Page Cache: Enabled
    Page Cache Method: Disk (basic)

  24. Frederick Townes
    Member
    Posted 4 years ago #

    I believe this issue is now fixed in the latest development version.

  25. ArcadeBB
    Member
    Posted 4 years ago #

    Cool, I am going to download and test it out.

  26. Frederick Townes
    Member
    Posted 4 years ago #

    Ok, if there are issues, submit a bug submission form please.

  27. ArcadeBB
    Member
    Posted 4 years ago #

    W3TC is an awesome plugin but I need to get pass this bug before I used W3TC for all my blogs.

    mclude and mfunc still do not work on the latest W3TC Developement Version Page Cache Disk(Basic) Mode.

    The file that is "mclude" needs an echo statement, else site will go blank. The same file works on WP Super Cache.

    W3TC shows the same time for mfunc code below.
    <!--mfunc echo 'real time = '.date('H i s',time()); -->
    <?php echo 'real time = '.date('H i s',time()); ?>
    <!--/mfunc-->

    <?php echo ' | cached time = '.date('H i s',time());?>
    WP Super Cache show different time using Half Cache Mode.

  28. Frederick Townes
    Member
    Posted 4 years ago #

    Please submit a bug submission form from the support tab of the plugin.

Topic Closed

This topic has been closed to new replies.

About this Topic