Title: Javascript Libraries?
Last modified: August 22, 2016

---

# Javascript Libraries?

 *  Resolved [BackpackersUnion](https://wordpress.org/support/users/backpackersunion/)
 * (@backpackersunion)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/javascript-libraries/)
 * Very cool plugin, thanks for creating!
 * Will Optimizing JavaScript with Autoptimize conflict with the benefits of using
   a javascript library (Like the plugin “[Use Google Libraries](https://wordpress.org/plugins/use-google-libraries/)“)?
 * Thanks again!
 * Carl
 * [https://wordpress.org/plugins/autoptimize/](https://wordpress.org/plugins/autoptimize/)

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

 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/javascript-libraries/#post-5773955)
 * It will work, but it will be less efficient; “use google libraries” will offload
   requests for individual JS-files to Google, but those requests remain. Autoptimize’s
   goal is to aggregate as many JS-files as possible, to have less requests, but
   it will only act on local files.
 * As an example, suppose you have a site with 10 local javascript files. In that
   case;
    * using Google Libraries you would have 10 requests, e.g. 6 local and 
   4 offloaded to Google * using Autoptimize you would have 2 requests, e.g. 1 aggregated
   JS-file and one file you had to exclude from aggregation * using Google Libraries
   and Autoptimize, you would have 6 requests, 1 aggregated JS-file, 1 file excluded
   from aggregation and 4 offloaded to Google.
 * Now it would take testing (on webpagetest.org) to see what solution performs 
   best, but my money would we on the Autoptimize-only solution, as extra requests
   tend to be more costly, even if to Google.
 * Hope this helps,
    frank
 *  Thread Starter [BackpackersUnion](https://wordpress.org/support/users/backpackersunion/)
 * (@backpackersunion)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/javascript-libraries/#post-5774123)
 * Thanks for the great explanation! I’ve begun testing it out and I’m pretty sure
   your theory is going to prove correct. One additional benefit of the plugin I
   mentioned is it checks to see if the script is already loaded into the users 
   cache to bypass having to downloaded it again, but what you said makes sense 
   where the checking process might be more expensive then just downloading the 
   single bundled JS file.
 * A few follow up questions I had (Sorry for the length!):
 * 1. I’m trying to figure out what the “CDN Base URL” options is looking for? I
   use CloudFlare primarily but also have access to MaxCDN which I might start to
   implement alongside or instead of CloudFlare. Do you know what information I 
   should be asking for from the CDN’s?
 * I’m assuming this option will look for image URL’s in the CSS and then push them
   to the CDN? Is there any scenario this option shouldn’t be used?
 * 2. The option “Generate data: URIs for images?” I’m not clear on. I do use a 
   lot of “background: url(‘image’);”, in my css for page background and button 
   icons, is this what this is intended to optimize? Also, any scenario it shouldn’t
   be used (i.e. lots of images referenced in CSS but not used on all pages?)?
 * 3. I’ve noticed after clicking “Save Changes and Empty Cache” several page loads
   are much slower. Is this Autoptimize locating a new JS files (CSS on first page)
   and compressing them? So, should I navigate around the site after a “Save…” to,
   essentially, ‘load up the plugin with the files’?
 * Sorry for the barrage of questions. I’m pretty excited about your plugin and 
   want to maximize the effect.
 * Thanks for all your help Frank!
 * Regards,
    Carl
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/javascript-libraries/#post-5774128)
 * so, for (1); maxcdn would work as it is a pull-type CDN, cloudflare would not.
 * (2); best to be used if you have background images that are present on each &
   every page
 * (3); correct, AO needs to regenerated it’s cache, which indeed means you take
   a small hit for every autoptimized file not in cache. navigating around the site
   would definitively help.
 * kind regards,
    frank
 *  Thread Starter [BackpackersUnion](https://wordpress.org/support/users/backpackersunion/)
 * (@backpackersunion)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/javascript-libraries/#post-5774146)
 * You rock!
 * Thanks for all your help and the great work on AO!
 * All the best,
    Carl

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

The topic ‘Javascript Libraries?’ is closed to new replies.

 * ![](https://ps.w.org/autoptimize/assets/icon-256X256.png?rev=2211608)
 * [Autoptimize](https://wordpress.org/plugins/autoptimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/autoptimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/autoptimize/)
 * [Active Topics](https://wordpress.org/support/plugin/autoptimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/autoptimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/autoptimize/reviews/)

## Tags

 * [js](https://wordpress.org/support/topic-tag/js/)

 * 4 replies
 * 2 participants
 * Last reply from: [BackpackersUnion](https://wordpress.org/support/users/backpackersunion/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/javascript-libraries/#post-5774146)
 * Status: resolved