• Resolved spark0118

    (@spark0118)


    Hi,

    Great plugin, it is solving many optimisation requirements for me. Thanks!

    I was hoping you could give me a point in the right direction.

    I have a Multisite installation, all the subsites are clones of a master site. Due to this all the JS and CSS files are the same.

    What I want to do is rewrite all the urls to point to the actual file on the server instead of using the subsite path. Then I want those files on my CDN without the subsite folders. I want to use the Autoptimize features to minimise and group the files.

    For example, this:
    https://domain.com/subsite/path/to/file1.js
    https://domain.com/subsite/path/to/file2.js

    Will become:
    https://domain.com/path/to/file1.js
    https://domain.com/path/to/file2.js

    Then I want the file on my CDN like this:
    https://mycdnprovider.com/path/to/cache/js/alloptimisedfiles.js

    My issues:

    If I use Autoptimize CDN setting I still get the subsite path and site number folder in the URL. I can replace the URLs myself using a snippet which works, but I still get the site number folder and for some reason Autoptimize also stops optimising JQuery which I’m hoping to do.

    From here the simplest solution I see is being able to remove the subsite path and folder number from the URL given by Autoptimize that should solve all the issues.

    I am pretty sure I could achieve this replacing the URL myself but I just wanted to see if you had any tricks before I start work on making that happen.

    On a side note, is it possible to specifiy groups of JS and CSS files? I have many libraries include that will rarely update but I also have custom code that will regulaly update. It would be great to be able to group these into seperate optimised files.

    I really appreiciate any help/pointers you can give and appriciate this is not a standard install.

    Thanks again for the great plugin.

    All the best, Daniel

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter spark0118

    (@spark0118)

    I am pretty sure I could achieve this replacing the URL myself but I just wanted to see if you had any tricks before I start work on making that happen.

    On further thought, this likely won’t work because the files will not be available in the made up folder. Which only leaves a solution through altering Autoptimize.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    try this code snippet;
    add_filter( 'autoptimize_separate_blog_caches', '__return_false');

    🙂

    Thread Starter spark0118

    (@spark0118)

    If this does what I think it does, that is amazing! Thanks for the quick reply!

    Thread Starter spark0118

    (@spark0118)

    Success! That combined with my origional snippet (to remove the subsite directory) worked perfectly!

    Any thoughts on the multiple groups for JS and CSS files?

    And on another side note, I have removed js/jquery/jquery.js from exclusion but it is not being optimised, along with jquery-migrate.min.js? Any ideas?

    Thanks, Daniel

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Any thoughts on the multiple groups for JS and CSS files?

    no support for that in AO I’m afraid (although for CSS you could play with values in the media-attribute, if those are not in use yet).

    And on another side note, I have removed js/jquery/jquery.js from exclusion but it is not being optimised, along with jquery-migrate.min.js? Any ideas?

    no idea … a plugin that uses AO’s API to exclude those?

    Thread Starter spark0118

    (@spark0118)

    no support for that in AO I’m afraid (although for CSS you could play with values in the media-attribute, if those are not in use yet).

    All good, more of a nice to have anyway.

    no idea … a plugin that uses AO’s API to exclude those?

    Interesting, I’ve only just installed and turned it on… I’ll do some more debugging.

    Thanks again for the fast and effective support.

    Daniel

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    you’re welcome, feel free to leave a review of the plugin and support here! 🙂

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Customising for Multisite’ is closed to new replies.