WordPress Plugin: Google AJAX Libraries API Plugin

Google Code It didn't take long for WordPress plugin authors to take advantage of the recently released AJAX Libraries API from Google. I've found two plugins so far: "Google AJAX Libraries API Plugin" from clearskys.net and "WordPress Plugin: Google AJAX Libraries API" from lud.icro.us. I chose the former, of course, because the latter is just plain LUDICROUS. I'm joking, of course. Either plugin will probably work as well as the other.


Use this plugin!

Every time you visit a website, all of the elements of that website have to be downloaded at least once. External CSS and JavaScript files are cached by your browser. This is what makes navigating through additional pages at a particular website faster than loading the initial page.

The problem with this caching method is that it has to happen for every website you visit because the URLs that point to the scripts are always different. The Google API will solve that problem. I'll give you an example based on my browsing habits.

Let's say I go to "Asian Ramblings" to read Steve's latest attempts at wit and wisdom and he uses the Google API plugin. After I'm done, I decide to head over to "More Than Scratch the Surface" to see if Stephen has a new WordPress plugin to try out and he also uses the Google API plugin. The first page load Stephen's blog is going to be faster than it would be without the plugin because my browser has already cached the JavaScript from the same source URL.

Let's say I then go to check out JD's shiny new header image at "I Do Things So You Don't Have To" and she doesn't use the plugin. It's going to seem as slow as molasses compared to the other blogs I visited. And what happens when I visit at Lin at "Telling It Like It Is" to read her article about the Six Flags Over Georgia decapitation article and she doesn't use the plugin either? Another slow loading page compared to what it could be.

The Caveat

The only problem with using Google's API is what if it stops working? Neither of the plugins I mentioned actually replaces the code used by your WordPress installation. They just tell it go fetch the code from someplace else. If you deactivate the plugin, your installation returns to its previous state.

I don't see it as a real problem right now. In fact, I think it's going to save a whole lot of time and bandwidth for most of us in the long run. Someone mentioned, somewhere, that if could halt the page like AdSense ads do from time to time. Well, if you're displaying AdSense ads then you wouldn't know the difference, would you? I actually haven't seen AdSense ads halt the display of a page for long, long time — probably more than a year. (Perhaps it's one of the reasons Google bought all that dark fiber?)

Privacy Concerns

I've also seen this mentioned in more than one place. The headers from your site are passed to Google through one or more of the script and Google can track browsing habits with it.

Let's get real. A lot of people are using Google Analytics which collects the same information. If you use Google's Webmaster Tools, some of that information is there as well. In other words, Google gets that information from multiple sources so this privacy concern is no more an issue than the others.

Questions

If you have questions, I don't really have any answers. I'm using the first plugin I mentioned right now. I also optimized some other things on the blog which I haven't mentioned yet, but suffice it say that AdSense and WordPress caching don't get along in the way I display AdSense. I had to do other things to speed things up a bit.

(Update 1: It appears that Ajax Edit Comments stopped working. I don't know if it's a conflict or Firefox 3 — I have another plugin that doesn't work with Fx 3 — I disabled it and will reenable it if the browser is the only problem.)

(Update 2: It turns out that I had to change 1.2.6/jsquery.min.js to 1.2.3/jsquery.js in the plugin to maintain compatibility with AEC.)

Similar Posts:

18 Comments

  1. Lin says:

    Slow loading page, huh? Darn, I hate that. I'm curious about "the other things" you did but haven't explained yet. What other things did you do? I'll check into this and see what I can do. I hate slow loading pages, and have actually been thinking maybe it was just my browser. Thanks for the heads up. This sort of "back office" stuff is handled by someone else, as I'm clueless about that sort of thing. I'll drop her a note this morning and see what can be done.

    My latest blog post: Children and Divorce: How to Tell Children About Your Divorce

  2. Looks like I'm gonna need a shiny new plug-in!

    Thanks for the article and the link!

    My latest blog post: I Ate an Expensive Candy Bar so you don't have to

  3. Lin says:

    No problem, it's a question I've had for a little while, but didn't know how or where to run a test on it.

    I've now removed several cumbersome, slow-loading, script widgets from my sidebars. As much as I like having the Twitter widget on my sidebar, I may have to remove that as well, if it ends up being a problem with loading time.

    Page loading time is an important factor for any blog, so I really do appreciate it being brought to my attention. I've worked very hard to build my blog, with a combination of 'social' posts mixed with 'authority' posts, and I wouldn't want loading times to cause people to become impatient and not read my posts or subscribe. I really appreciate the heads up. How's the load time now, if you don't mind checking? :???:

  4. Lin says:

    Twitter widget is now gone. :cry:

    I'll check out that link too and see what that's about. :smile:

    My latest blog post: Children and Divorce: How to Tell Children About Your Divorce

  5. Louise says:

    Let me see if I have this straight- I install this plugin to improve the reader's experience, right?

    Sounds like a good idea but I might wait a bit to jump on board. I "broke" my site a couple of weeks ago trying a new SEO trick and just got it running smoothly again.

    I am going to try out the optimization link above to check page loading speed.

    • Yes, Louise,

      Unless you're comfortable switching things back and forth a hundred times when something breaks, it's not a good idea to make changes. Of course, I'm always available to assist when I make a suggestion like this.

  6. Lin says:

    Okay, I checked out that link and had a couple Cautions and Warnings about loading times. Problem for me is, I have no clue about what it's suggesting be done about it. Number of images, I would assume included many of the widgets I've since removed. Maybe it doesn't like my header images. I'll watch and re-analyze in a couple days and see what it shows then.

    • You can safely ignore the # of images and external CSS and Javascript notice. There's nothing anyone can do about that. The key is to look at the before and after and see what changed. If nothing changes, it isn't worth using a particular plugin or code. As far as the "other things" I did, that's best explained in another post. I just have to write it — maybe today or tomorrow, but definitely before the holiday weekend is over.

  7. Stevo says:

    Thanks for the nod. What do you mean "attempt at wit"? I am the wittiest of the witty, or pretend to be.

    I'll check out this new API dealio. Sounds very good.

    My latest blog post: an evil weekend

  8. I am forever trying to increase ways to make my loading go quicker on my blog… thanks a bunch for this tip bro! I dont see you coming around LBB too much anymore. =)

    My latest blog post: Pepperjam Network Increases Referral Money

  9. meethere says:

    coool plugin
    gonna use it for sure.. thanks. :wink:

    My latest blog post: Human Tetris – Hillarious video

  10. Jason from Monex Fraud says:

    I'm gonna give this plugin a shot, thanks!

  11. Don says:

    Yes thank you for the plugin, Jason thanks for the help by the way!

  12. Hi,

    I uninstalled your plugin, but it seems in the page-source I can still see the scripts referring to the apis at google.com instead of using local scripts.

    How can I restore this? Thanks a lot.

    So I would like to replace the statments with the below, but have no idea where I need to change this:

    Pim

Leave a Reply

CommentLuv Enabled

This site uses KeywordLuv. Enter YourName@YourKeywords in the Name field to take advantage.

Anti-Spam Protection by WP-SpamFree