• Resolved petro

    (@petro)


    Hello,

    I am serving CSS and JS files from a CDN.
    The server changes automatically the hostname of the stylesheets and script URLs, rewriting the site URL with the CDN URL, but only in the HTML source code, not in the HTTP headers.

    When the plugin tries to preload the stylesheets and the scripts with an HTTP link preload header, it tries preloading them at their Site URL location, but they are loaded from their CDN location.

    As a result, the preload requests are wasted, and the actual resources are loaded without preload.

    There should be a way to declare the hostname from which the resources will be loaded. Is there something like that?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter petro

    (@petro)

    For the record, I solved that by putting in wp-config.php the following code:

    define('MMR_CSS_CACHE_URL','https://cdn-url.com/wp-content/mmr');
    define('MMR_JS_CACHE_URL','https://cdn-url.com/wp-content/mmr');

    However I still think this feature should be documented better, or ideally the user should see a back-end option.

    For the rest, the plugin is perfect!

    Plugin Author launchinteractive

    (@launchinteractive)

    Ahh great. I’m glad you sorted this.
    I think your right.. we should update the documentation. How do you think we should word this?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Change host for link preload’ is closed to new replies.