Hosting minified CSS and JS files on CDN

Hello There,

I already have consolidated + minified CSS and JS files. How can I leverage WPMU CDN to host them to get the performance gains? Thanks!

  • Dimitris Kalliris
    • Support Team Lead

    Hello there Ben,

    hope you're doing well and thanks for reaching us!

    I guess that you already use HummingBird plugin and optimize your CSS and JS files via the Asset Optimization section. In order to serve the newly generated files from our CDN service, you just have to enable it in the main page or the "Settings" sub-menu:

    [attachments are only viewable by logged-in members]

    More info about this HummingBird module can be found here:

    https://vvpmudev.com/docs/wpmu-dev-plugins/hummingbird/#chapter-4

    Please let me know if I'm missing something else here. :slight_smile:

    Thank you,

    Dimitris

  • Ben
    • WPMU DEV Initiate

    Thanks for your response, Dimitris. I am not using HummingBird module as it recommended modifying each file individually. I used autoptimizer instead to consolidate and minify CSS+JS files. Now, I would like to have these files hosted on the CDN network for faster performance.

    Appreciate your help!

    Regards,

    Ben

  • Nastia
    • Ex Staff

    Hello Ben

    I trust you are doing well!

    The Autoptimize plugin moves all the optimizes CSS and JS files to /wp-content/cache/autoptimize/css/ folder. Because the Hummingbird plugin is not integrated with Autopoptimizer it will, upload all the CSS and JS files to the CDN, but not the one that are coming from /wp-content/cache/autoptimize/css/ directory. So the site’s files will be loading from WPMU DEV CDN and from the Optimizer plugin.

    The Optimizer plugin has a Supercharge Content Delivery with KeyCDN extension that will work with their plugin.

    To use WPMU DEV CDN fro CSS and JS files, I am afraid you may use it if minification will be done with Hummingbird plugin.

    Hope this helps!

    Cheers,

    Nastia

  • Ben
    • WPMU DEV Initiate

    Hi there,

    Thanks for you response. However, I am a bit confused. I do not understand what is meant by ‘ it will upload all the CSS and JS files to CDN’ in your email above. Could you please explain this.

    Regards,

    Ben

  • Nahid
    • Ex Staff

    Hey there Ben !

    Hope you are doing well today!

    Thank you for your query. We apologize about the confusion. Just to be more transparent, what my colleague Nastia tried to convey in her last response is, if the Hummingbird plugin’s CDN is enabled, it’ll automatically upload all the CSS and JS files that WordPress core uses and plugins/the theme enqueues into WordPress to the CDN.

    However, the Autoptimize plugin optimizes the CSS and JS files and stores them in a “custom” /wp-content/cache/autoptimize/ directory. But since the Hummingbird plugin doesn’t have an integration with the Autoptimize plugin, it neither recognizes nor uploads the files from this custom directory to the CDN.

    Hope this helps. Please let us know if you need any further assistance regarding this. Thanks!

    Kind regards,

    Nahid