• Random play does not seem to work when W3 Total Cache (arguably the most popular caching plugin) is enabled with Page Caching. Presumably this is because the randomisation only works once (when the page is cached) and subsequent hits show the same video.

    There are 2 possible solutions for this. One is to change the randomisation feature to use Javascript on the client side, rather than serverside. That is the video to show is randomly selected by the browser on the client side, when the iFrame is embedded. Alternatively, possibly simpler in this case (but less generic for other caching plugins) is to use the <!-- mfunc --> directives for dynamic content around the part which selects the random video. (More details here: https://www.ads-software.com/support/topic/is-there-a-way-to-make-specific-lines-of-code-not-cache?replies=5). The latter needs a few settings in the W3TC to use the right Disk Caching option and enable the dynamic content feature.

    https://www.ads-software.com/plugins/youtube-channel/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Aleksandar Uro?evi?

    (@urkekg)

    Thank you for this tip! I’m adding it to TODO.

    Thread Starter jbx

    (@jbx)

    No problem. If you choose the <-- mfunc --> approach you might face a few teething issues to get it to work, it has a few peculiarities, hopefully it doesn’t give you too many problems.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Random play and caching (W3TC)’ is closed to new replies.