Support » Plugin: W3 Total Cache » CDN: URLs not rewritten in the native WP audio playlist

  • Resolved allfadr

    (@allfadr)


    The CDN feature of W3TC does not rewrite the URLs of audio files in native WP playlists.

    Sorry, I can’t give you the site URL cause it’s still in dev. But the issue is easily understandable without it – please see below.

    Details:
    1) I turned on the CDN of the “Amazon S3-compatible” type, and connected my S3-compatible storage to the site. The connection works well, it successfully offloads whatever I tell it to offload – which is mostly audiofiles from the “Uploads” folder.
    2) If I insert a native WP audio player with a single audiofile in a post, the file’s URL is rewritten to the storage URL and the file is served from that storage URL. (I.e. everything’s fine.)
    3) BUT if I insert a native WP audio playlist (selecting several audio files in the Media Library) in a post, then the URLs of the audio are not rewritten. The audio is served from my main hosting. Which is not OK.

    (Meanwhile, the W3TC Debug field in the source of the post with the playlist says that all the audio URLs have been replaced with the respective S3-storage URLs. Which is obviously not so.)

    This rewriting behaviour doesn’t depend on the way I add the native playlist: either via a classic post editor ( => “Add Media”) or by a shortcode in Gutenberg.
    This doesn’t depend on other plugins that might hinder W3TC.
    This doesn’t depend on the theme I use. (But this is logical since the bug is somewhere on the backend.)

    The problem must be somewhere in the process of providing audio file URLs from the Media Library to the native playlist.
    Could it be somewhere on the side of W3TC?

    Thanks.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Marko Vasiljevic

    (@vmarko)

    Hello @allfadr

    I am sorry about the issue you are having with the CDN URL rewrite and I am happy to answer.

    3) BUT if I insert a native WP audio playlist (selecting several audio files in the Media Library) in a post, then the URLs of the audio are not rewritten. The audio is served from my main hosting. Which is not OK.

    (Meanwhile, the W3TC Debug field in the source of the post with the playlist says that all the audio URLs have been replaced with the respective S3-storage URLs. Which is obviously not so.)

    Can you please share where do you see that those files are not served from the CDN and the W3 Total Cache debug source comment?
    Thank you!

    allfadr

    (@allfadr)

    Where I see that the files are not served from the CDN:
    1) In the playlist, when I hover over the individual tracks and see their links at the bottom of the browser. Also – when I right-click individual tracks and choose to “Copy link address” and then insert this address somewhere to see it. The address leads to my “Uploads” folder, not the CDN.
    2) In the HTML source of the page when I inspect it. The addresses of the playlist items, as well as the address of the currently playing track (in the <mediaelementwrapper><audio>) all lead to my site’s “Uploads” folder, not the CDN.

    The W3TC debug source comment (I’ve masked the site address with NNNNNN.NNN):

    <!--
    Performance optimized by W3 Total Cache. Learn more: https://www.w3-edge.com/products/
    
    Object Caching 123/127 objects using disk
    Page Caching using disk: enhanced (User is logged in) 
    Content Delivery Network via S3-compatible: w3tc-test.io.activecloud.com
    Replaced URLs for CDN:
    https://NNNNNN.NNN/wp-content/uploads/2019/04/favicon.png => https://w3tc-test.io.activecloud.com/wp-content/uploads/2019/04/favicon.png
    https://NNNNNN.NNN/wp-content/uploads/2019/04/szapka.jpg => https://w3tc-test.io.activecloud.com/wp-content/uploads/2019/04/szapka.jpg
    https://NNNNNN.NNN/wp-content/uploads/2019/04/znak.png => https://w3tc-test.io.activecloud.com/wp-content/uploads/2019/04/znak.png
    https://NNNNNN.NNN/wp-content/uploads/mlftest/01.-Vereschaki-Village-A-broad-lake-lies-over-our-gates.mp3 => https://w3tc-test.io.activecloud.com/wp-content/uploads/mlftest/01.-Vereschaki-Village-A-broad-lake-lies-over-our-gates.mp3
    https://NNNNNN.NNN/wp-content/uploads/mlftest/test1/02.-Young-girls-wer-making-merry-in-the-street.mp3 => https://w3tc-test.io.activecloud.com/wp-content/uploads/mlftest/test1/02.-Young-girls-wer-making-merry-in-the-street.mp3
    https://NNNNNN.NNN/wp-content/uploads/2019/11/03.-Vereschaki-Village-In-our-street.mp3 => https://w3tc-test.io.activecloud.com/wp-content/uploads/2019/11/03.-Vereschaki-Village-In-our-street.mp3
    https://NNNNNN.NNN/wp-content/uploads/mlftest/04.-Vereschaki-Village-Oh-little-swallow.mp3 => https://w3tc-test.io.activecloud.com/wp-content/uploads/mlftest/04.-Vereschaki-Village-Oh-little-swallow.mp3
    https://NNNNNN.NNN/wp-content/uploads/mlftest/test1/05.-Vereschaki-Village-a-By-Kiev-b-In-the-fiels.mp3 => https://w3tc-test.io.activecloud.com/wp-content/uploads/mlftest/test1/05.-Vereschaki-Village-a-By-Kiev-b-In-the-fiels.mp3
    https://NNNNNN.NNN/wp-content/uploads/mlftest/Vereshchaki-2/35.-Yalovka-Village-The-sun-is-shinning-over-the-woods.mp3 => https://w3tc-test.io.activecloud.com/wp-content/uploads/mlftest/Vereshchaki-2/35.-Yalovka-Village-The-sun-is-shinning-over-the-woods.mp3
    https://NNNNNN.NNN/wp-content/uploads/mlftest/Vereshchaki-2/36.-Yalovka-Village-a-On-the-planks-at-the-river-bank-b-People-were-saying-that-we-will-be-co.mp3 => https://w3tc-test.io.activecloud.com/wp-content/uploads/mlftest/Vereshchaki-2/36.-Yalovka-Village-a-On-the-planks-at-the-river-bank-b-People-were-saying-that-we-will-be-co.mp3
    https://NNNNNN.NNN/wp-content/uploads/mlftest/Vereshchaki-2/37.-Mishkova-Village-Glory-to-God.mp3 => https://w3tc-test.io.activecloud.com/wp-content/uploads/mlftest/Vereshchaki-2/37.-Mishkova-Village-Glory-to-God.mp3
    https://NNNNNN.NNN/wp-content/uploads/mlftest/Vereshchaki-2/38.-Mishkova-Village-Thy-Nativity.mp3 => https://w3tc-test.io.activecloud.com/wp-content/uploads/mlftest/Vereshchaki-2/38.-Mishkova-Village-Thy-Nativity.mp3
    https://NNNNNN.NNN/wp-content/uploads/mlftest/Vereshchaki-2/39.-Mishkova-Village-It-is-truly-meet-and-right.mp3 => https://w3tc-test.io.activecloud.com/wp-content/uploads/mlftest/Vereshchaki-2/39.-Mishkova-Village-It-is-truly-meet-and-right.mp3
    https://NNNNNN.NNN/wp-content/uploads/mlftest/Vereshchaki-2/20.-Vereschaki-Village-Why-did-you-a-snowball-cherry-bush-shed-your-leaves.mp3 => https://w3tc-test.io.activecloud.com/wp-content/uploads/mlftest/Vereshchaki-2/20.-Vereschaki-Village-Why-did-you-a-snowball-cherry-bush-shed-your-leaves.mp3
    https://NNNNNN.NNN/wp-content/uploads/mlftest/Vereshchaki-2/21.-Vereschaki-Village-My-mother-will-not-reprove-me-for-a-Russian-lad..mp3 => https://w3tc-test.io.activecloud.com/wp-content/uploads/mlftest/Vereshchaki-2/21.-Vereschaki-Village-My-mother-will-not-reprove-me-for-a-Russian-lad..mp3
    https://NNNNNN.NNN/wp-content/uploads/mlftest/Vereshchaki-2/22.-Yalovka-Village-A-wedding-dance-hopak.mp3 => https://w3tc-test.io.activecloud.com/wp-content/uploads/mlftest/Vereshchaki-2/22.-Yalovka-Village-A-wedding-dance-hopak.mp3
    https://NNNNNN.NNN/wp-content/uploads/mlftest/Vereshchaki-2/23.-Yalovka-Village-Goodbye-and-do-not-forget-my-sufferings.mp3 => https://w3tc-test.io.activecloud.com/wp-content/uploads/mlftest/Vereshchaki-2/23.-Yalovka-Village-Goodbye-and-do-not-forget-my-sufferings.mp3
    https://NNNNNN.NNN/wp-content/uploads/mlftest/Vereshchaki-2/24.-Yalovka-Village-A-Serbian-girl.mp3 => https://w3tc-test.io.activecloud.com/wp-content/uploads/mlftest/Vereshchaki-2/24.-Yalovka-Village-A-Serbian-girl.mp3
    https://NNNNNN.NNN/wp-content/uploads/2019/11/Zhurovicz_0216_II05-Ой-там-за-горамі-сінеют-мора.mp3 => https://w3tc-test.io.activecloud.com/wp-content/uploads/2019/11/Zhurovicz_0216_II05-Ой-там-за-горамі-сінеют-мора.mp3
    https://NNNNNN.NNN/wp-content/uploads/2019/11/Zhurovicz_0216_II04-Любіла-хлопца-з-трыццатого-року.mp3 => https://w3tc-test.io.activecloud.com/wp-content/uploads/2019/11/Zhurovicz_0216_II04-Любіла-хлопца-з-трыццатого-року.mp3
    https://NNNNNN.NNN/wp-content/uploads/2019/11/Zhurovicz_0216_II06-Ой-да-ішлі-хлопцы-з-ярмолку.mp3 => https://w3tc-test.io.activecloud.com/wp-content/uploads/2019/11/Zhurovicz_0216_II06-Ой-да-ішлі-хлопцы-з-ярмолку.mp3
    https://NNNNNN.NNN/wp-content/uploads/mlftest/Vereshchaki-2/25.-Yalovka-Village-A-young-lady.mp3 => https://w3tc-test.io.activecloud.com/wp-content/uploads/mlftest/Vereshchaki-2/25.-Yalovka-Village-A-young-lady.mp3
    https://NNNNNN.NNN/wp-content/uploads/mlftest/Vereshchaki-2/26.-Yalovka-Village-Lezovinka.mp3 => https://w3tc-test.io.activecloud.com/wp-content/uploads/mlftest/Vereshchaki-2/26.-Yalovka-Village-Lezovinka.mp3
    
    Minified using disk
    Database Caching using disk (Request-wide User is logged in)
    
    Served from: NNNNNN.NNN @ 2019-11-25 10:27:58 by W3 Total Cache
    -->
    • This reply was modified 11 months ago by allfadr.
    allfadr

    (@allfadr)

    @vmarko
    Where I see that the files are served not from the CDN:
    1) In the playlist itself, when I hover over individual tracks and their respective links are shown to me at the bottom of the browser. Also – when I right-click individual tracks and choose to “copy link address” and then paste it somewhere to see the URL.
    2) In the source code of the page when I inspect it. The individual links to playlist item files, and the link of the currently playing file (in the <mediaelementwrapper><audio>), – they all lead to my site’s “Uploads” folder, not to the CDN.

    The W3TC debug comment is here:
    https://docs.google.com/document/d/1BgLBzylL-ylapvyGTDW3G0ZzBWjwJO3p1rQAQoEF0fg/edit?usp=sharing

    • This reply was modified 11 months ago by allfadr.
    Plugin Support Marko Vasiljevic

    (@vmarko)

    Hello @allfadr

    Can you please go to Performance>CDN and hick the Use CDN links for the Media Library on admin pages box and save all settings.
    Please let us know if this helps!

    allfadr

    (@allfadr)

    @vmarko
    No, turning this setting on or off doesn’t help.

    Plugin Support Marko Vasiljevic

    (@vmarko)

    Hello @allfadr

    We’ve checked this and this depends on the HTML your player generates.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘CDN: URLs not rewritten in the native WP audio playlist’ is closed to new replies.