Support » Plugin: W3 Total Cache » Trouble with CDN “custom file list” not including files in CDN

  • Resolved sadhaka

    (@sadhaka)


    I am trying to use W3TC in the “CDN > Custom file list” to include files that are outside of the WordPress environment to be hosted with the CDN (Amazon CloudFront), but I’m having some trouble.

    In my domain the WordPress begins at:

    https://www.example.com/wp/

    … but I have files in places like:

    https://www.example.com/external/

    and:

    https://www.example.com/external/images/

    … that I want to be hosted with the CDN.

    I have specified these in the “Custom file list” in this way:

    https://www.example.com/external/images/*.jpg
    https://www.example.com/external/images/*.png
    https://www.example.com/external/images/*.svg

    … but even after purging the CDN and caches, they do not appear to become hosted with the CDN.

    Is this not working because these directories/files are not just “outside of theme or other common directories” (as per the text underneath the “Custom file list” box) but are actually outside of the WordPress level (even though all pages in them include “[server-path]/wp-load.php” at the top)?

    • This topic was modified 1 year, 1 month ago by sadhaka.
    • This topic was modified 1 year, 1 month ago by sadhaka.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Marko Vasiljevic

    (@vmarko)

    Hello @sadhaka

    Thank you for your inquiry and I am happy to assist you with this.
    Adding the URL is not the way to do this. You need to use a file path. You can use placeholders {wp_content_dir}, {plugins_dir}, {uploads_dir} instead of writing folder paths (wp-content, wp-content/plugins, wp-content/uploads).

    I hope this helps!

    Thread Starter sadhaka

    (@sadhaka)

    Thank you @vmarko – by “file path” do you mean a server path?

    Also – I know that you can use placeholders for common WordPress directories, but I’m not sure how I could use a placeholder for my own directories that I have created outside the WordPress installation.

    Plugin Support Marko Vasiljevic

    (@vmarko)

    Hello @sadhaka

    I’ve never tested this use case but in this case, you should put the server file path in the Custom file list.
    Thanks.

    Thread Starter sadhaka

    (@sadhaka)

    I think I’ve now tested all variants of server paths, absolute and relative, with specific or regex-style suffices, and none seem able to enable W3TC to cause the targeted files to be hosted with the CDN.

    I suppose I shouldn’t be too surprised at this, since these files do after all reside outside the WordPress environment, but it was worth a shot.

    Unless anyone reading this has another suggestion that I haven’t thought of, then I guess my only option is to copy/move the files in question to a directory in my child theme, and rewrite the paths in the referring pages to suit.

    Plugin Support Marko Vasiljevic

    (@vmarko)

    Hello @sadhaka

    Thanks for the info. After checking this and testing I can confirm that this is not supported in W3 Total Cache.
    Thank you!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Trouble with CDN “custom file list” not including files in CDN’ is closed to new replies.