8 Comments

  1. Diogene

    If you don’t know how to use a CDN don’t use it. things can get worst with a not fully tested CDN than without.
    Normally plug and play plug in or hosting options for CDN work bad 90% of time and don’t really improve performance for Average users .
    If you build a website with international target for large audience you should take a good CDN (paying) service.

    But the idea is nice and is well developed.

    Report

    • Milan

      I agree that in general you should be careful when using CDN, even for this plugin I recommended testing and wrote FAQ entry “Will my site be faster when I start using commonWP?”.

      However, note that there is one difference between this and other CDN solutions. When using commercial CDN, each file is used only by your own site, not by others. That means that your visitor almost certainly won’t have it cached in their browser, and that unless you have large traffic from all over the world, it won’t be cached even in some POPs of CDN.

      With this solution, you are offloading only files that are used by open source plugins, themes, or WordPress core itself, and that are used by many other sites (in WordPress core case, we are talking about over 30% of sites). Some files are used on almost all WordPress sites (jquery.js, jquery-migrate.min.js, wp-embed.min.js, wp-emoji-release.min.js). Even now, with just around hundred of sites that are using commonWP, those files are mostly cached by CDN’s POPs around the world, I have tested that (and anyone can too with switching locations in VPN/TOR and watching response headers). With more sites using it, we are increasing chance that this is true for files from popular plugins as well (Jetpack, WooCommerce, Gutenberg…), and chances are increasing that some files might already be cached by visitor’s browser. More sites = better results. I wrote this in FAQ entry “Are there any benefits other than speed?“.

      Also note that you can tell commonWP to offload only some files to CDN, for example only those popular files. There is a code example under “Deciding should path be rewritten“.

      Report

  2. apachx

    Only JavaScript and CSS? No images? Thank You, but no.

    Report

    • Milan

      This CDN is only for open source assets. Images from media library are not open source, while most/all JavaScript and CSS and assets referenced from them (images, fonts…) are.

      Note that you can use other CDN as you would normally do in combination with commonWP for images or other assets. For free solution for images in media library, there is CDN by Jetpack Photon but it has condition that you must use Jetpack and connect site to their service.

      Using CDN for images in media library requires more caution (see comment by Diogene). For new visitors, CSS/JavaScript files are more important because it’s the first thing browser requests when loading page and they affect page’s rendering time. Images are referenced later in HTML, are usually below the fold, maybe even lazy loading is used, so priority and effect of performance is lower. For high trafficked sites that rely on media content, CDN for media library images is important too.

      Report

  3. Scott Hartley

    I like the idea as it’s plug and play like JetPack photon, but if you’re going for a CDN just use cloudflare it is also free, and the performance benefits will be easily noticed.

    Report

Comments are closed.

%d bloggers like this: