Random play and caching (W3TC)
-
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.
- The topic ‘Random play and caching (W3TC)’ is closed to new replies.