WordPress.org

Ready to get started?Download WordPress

Forums

WP Super Cache
[resolved] Dynamic chaching ignores tag (2 posts)

  1. Firebrand_90
    Member
    Posted 1 year ago #

    <!-- dynamic-cached-content --><?php
    $file = 'video.txt';
    $data = file($file);
    $line = trim($data[array_rand($data)]);
    
    echo <<<YT
    <iframe width="300" height="225" src="http://www.youtube.com/embed/$line?rel=0&vq=large&theme=light&color=white&showinfo=0&iv_load_policy=3" frameborder="0" allowfullscreen></iframe>
    YT;
    ?><!-- /dynamic-cached-content -->

    Random youtube video still gets cached.

    Any idea?

    http://wordpress.org/extend/plugins/wp-super-cache/

  2. Firebrand_90
    Member
    Posted 1 year ago #

    I realized even the new lines and structures do matter.

    I rewrote into this form

    <!--dynamic-cached-content--><?php
    $file = 'video.txt';
    $data = file($file);
    $line = trim($data[array_rand($data)]);
    
    echo <<<YT
    <iframe width="300" height="225" src="http://www.youtube.com/embed/$line?rel=0&vq=large&theme=light&color=white&showinfo=0&iv_load_policy=3" frameborder="0" allowfullscreen></iframe>
    YT;
    ?><!--
    $file = 'video.txt';
    $data = file($file);
    $line = trim($data[array_rand($data)]);
    
    echo <<<YT
    <iframe width="300" height="225" src="http://www.youtube.com/embed/$line?rel=0&vq=large&theme=light&color=white&showinfo=0&iv_load_policy=3" frameborder="0" allowfullscreen></iframe>
    YT;
    --><!--/dynamic-cached-content-->

    And now it works!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.