Customising for Multisite
-
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.jsWill become:
https://domain.com/path/to/file1.js
https://domain.com/path/to/file2.jsThen I want the file on my CDN like this:
https://mycdnprovider.com/path/to/cache/js/alloptimisedfiles.jsMy 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
The topic ‘Customising for Multisite’ is closed to new replies.