Viewing 15 replies - 1 through 15 (of 94 total)
  • Plugin Author Martin Tod

    (@mpntod)

    It is I’m afraid. You’ll need to adjust the settings on the Page Cache page.

    Martin

    Thread Starter optimisto

    (@optimisto)

    Thank you, Martin!

    What would you suggest to adjust?
    Maybe put some kind of exception?

    Plugin Author Martin Tod

    (@mpntod)

    Apparently there might be a fix for this – via ‘fragment cacheing’.

    It doesn’t look _totally_ straightforward – and it may take a while to sort this out!

    You can find details on the FAQ page in your W3 Total Cache installation by looking for fragment cacheing!

    Martin

    Thread Starter optimisto

    (@optimisto)

    Okay… The FAQ says:

    How do I implement page fragment caching?
    
    First you need to define W3TC_DYNAMIC_SECURITY in your wp-config.php file.
    
    define('W3TC_DYNAMIC_SECURITY', 'somesecurestring');
    
    Edit your templates with the following syntax to ensure that dynamic features remain so. Replace W3TC_DYNAMIC_SECURITY with content of the constant or use echo to print constant:
    
    Example 1:
    <!-- mfunc W3TC_DYNAMIC_SECURITY any PHP code --><!-- /mfunc W3TC_DYNAMIC_SECURITY -->
    Example 2:
    <!-- mfunc W3TC_DYNAMIC_SECURITY -->any PHP code<!-- /mfunc W3TC_DYNAMIC_SECURITY -->
    Example 3:
    <!--MFUNC W3TC_DYNAMIC_SECURITY           -->
                                          echo rand();
    <!--/mfunc W3TC_DYNAMIC_SECURITY -->
    Example 4:
    <!-- mclude W3TC_DYNAMIC_SECURITY path/to/file.php --><!-- /mclude W3TC_DYNAMIC_SECURITY -->
    Example 5:
    <!-- mclude W3TC_DYNAMIC_SECURITY -->path/to/file.php<!-- /mclude W3TC_DYNAMIC_SECURITY -->
    Be aware that WordPress functions will not be available.

    Martin, what should I place instead of “somesecurestring” and “any PHP code”? Also I’m not sure what the last warning is about…
    Please bare with me – I’m not a pro! :-0

    Plugin Author Martin Tod

    (@mpntod)

    Unfortunately, this is a fairly major piece of work to do to make this work. Rotating Tweets relies very heavily on WordPress functions to operate and the FAQ makes it clear that WordPress functions are not available for the plug-in to use!

    It’s doable, but it’s tricky!

    Thread Starter optimisto

    (@optimisto)

    Umh… So what should I do if I want to keep both of the plugins?
    There is no way to put Rotating Tweets in the exclusions?
    The tweets I rotate are usually updated once a day and it’s not a big deal if they don’t appear on the site right away.
    Maybe I could shorten the time the cache should refresh itself?
    Or is there a smarter way to solve this?

    Plugin Author Martin Tod

    (@mpntod)

    The simple solution is to reduce the duration of the WE Total Cache page cache.

    It would be a day or two’s work to invent a whole new system for bypassing the cache and probably isn’t worth it unless you are tweeting much more often.

    Thread Starter optimisto

    (@optimisto)

    Yes, Martin, it’s not worth the effort.
    So you suggest I should just shorten the Cache Preload Update interval?
    Rotating Tweets loads in the header – maybe I could exclude the header from caching? (header.php)
    Would that be enough?
    On the other hand – excluding the header from caching would slow down every page and kind of defeat the purpose of caching.
    Where does the Rotating Tweets plugin cache the tweets? Maybe I could put that location in the exceptions list of Total Cache?

    Plugin Author Martin Tod

    (@mpntod)

    I’m not sure it would work, because I suspect that W3 Total Cache caches each page as a whole including header.php.

    Rotating Tweets stores the tweets in the $options array and then renders them as text in the body of the page.

    We’d also need to test whether the mfunc code has to be written in the template or can be rendered by a plug-in.

    If the latter, the trick would be to add a flag that tells Rotating Tweets to take the text that was going to be written to the page – write it to a separate file – and, instead of returning the text, return the mclude text:

    So it would be:

    [rotatingtweets screen_name='your_name' render_to='hardcodedtweetdisplay.php]

    which would render as:

    <!-- mclude W3TC_DYNAMIC_SECURITY /wp-content/plugins/rotatingtweets/cache/hardcodedtweetdisplay.php -->
    <!-- /mclude W3TC_DYNAMIC_SECURITY -->

    If the former, you’d have to hardcode

    <!-- mclude W3TC_DYNAMIC_SECURITY /wp-content/plugins/rotatingtweets/cache/hardcodedtweetdisplay.php -->
    <!-- /mclude W3TC_DYNAMIC_SECURITY -->

    into your template yourself.

    Thread Starter optimisto

    (@optimisto)

    So I just put in header.php (where the plugin is called) this code?

    <!-- mclude W3TC_DYNAMIC_SECURITY /wp-content/plugins/rotatingtweets/cache/hardcodedtweetdisplay.php -->
    <!-- /mclude W3TC_DYNAMIC_SECURITY -->

    btw – this is what the plugin line in header.php looks like

    <?php echo do_shortcode( "[rotatingtweets screen_name='name' show_meta_timestamp ='0' show_meta_screen_name ='0' show_meta_via ='0' include_rts='1' tweet_count='10' exclude_replies ='1']" ) ?>

    Should I add in it this code too?:

    render_to='hardcodedtweetdisplay.php

    I guess I’m asking stupid questions, but I’m not a pro, Martin.

    Plugin Author Martin Tod

    (@mpntod)

    That’s the theory, but I haven’t written the code that would support this yet unfortunately. Apologies for giving the impression that I had!

    I’ll look into it tomorrow and see how easy it would be!

    Thread Starter optimisto

    (@optimisto)

    Thank you very much for the support, Martin! Do your magic ??

    Thread Starter optimisto

    (@optimisto)

    Any success, Martin?

    Plugin Author Martin Tod

    (@mpntod)

    I’ve uploaded a very experimental build as the ‘Development’ version.

    You need to use the Rotating Tweets shortcode variable w3tc_render_to, define W3TC_DYNAMIC_SECURITY in your wp-config.php file and enable ‘Late Initialization’ on the W3 Total Cache ‘Page Cache’ settings page.

    Martin

    Thread Starter optimisto

    (@optimisto)

    That’s great, Martin, thanks!
    What value should I put for the shortcode variable?
    And how do I define the W3TC_DYNAMIC_SECURITY in wp-config.php?
    I’m sorry but I’m just not that good in all this…

Viewing 15 replies - 1 through 15 (of 94 total)
  • The topic ‘W3 Total Cache Rotating Tweets = Not updating tweets?’ is closed to new replies.