• Resolved cadianshock

    (@cadianshock)


    Hi

    I have added my CDN https://xxxxxx.cloudfront.net/ but it’s not being replaced in the head or footer.

    My regular domain is being used to serve Autoptimise CSS and JS.

    I have tried removing the trailing slash too, but that makes no difference.

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    that’s weird …

    some questions:
    * did you clear W3 Total Cache (and any other page cache you might have)?
    * can you share a screenshot of your current AO CDN Settings?
    * can you share CDN Settings in W3 total cache?
    * does this also happen when CDN is off in W3 total cache or is W3TC is off temporarily?

    frank

    Thread Starter cadianshock

    (@cadianshock)

    Hi

    • I have cleared W3 and Autoptimise cache multiple times
    • This still happens with W3 CDN off

    All settings are here https://imgur.com/a/GjCqEkQ

    I also tried to use ob_start(), ob_get_contents(), etc to grab the wp_head() and then change the URL output by Autoptimize after everything is done. But I cannot change the out of Autoptimize using this method, head and footer.

    Perhaps that is expected and its adding it somewhere else.

    Thanks

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    bizarre … as a workaround you can use the autoptimize_html_after_minify filter to replace your domain with the cdn, something like;

    add_filter( 'autoptimize_html_after_minify', function( $html ) {
        return str_replace( 'https://cusscard.com/wp-content/cache/autoptimize/', 'https://xxxxxx.cloudfront.net/wp-content/cache/autoptimize/', $html );
    } );

    Is your site using standard WordPress directory structure?

    I was caught on this before…

    Thread Starter cadianshock

    (@cadianshock)

    Does that go in my themes functions.php?

    Thread Starter cadianshock

    (@cadianshock)

    Yes, that works!

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    happy to hear the workaround works cadianshock 🙂

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[NSFW] CDN URL is ignored’ is closed to new replies.