PDA

View Full Version : Use youtube? Don't let it slow your site down!


final kaoss
11-06-2013, 12:19 AM
So I came across this page today and it's working wonders. It took a page on my blog from 3mb to around 600kb in total size.
http://www.labnol.org/internet/light-youtube-embeds/27941/

All you have to do is pretty much write this in the footer & upload the file from the page above.

I suggest trying it on a page with 2 or more youtube videos and you will definitely see a change not only in the loading times of your pages but also a bit of a increase in your pagespeed/yslow scores on webpagetest.org and both of these are always a plus! :D

<script src="http://site.com/youtube.js"></script>

Max Taxable
11-06-2013, 02:08 AM
Hmm wonder how this works with AME? About to try it to find out - "can't hurt, can always revert."

OOPS after reading the entire article, two issues come up.

1.) I don't see any file from there to download.

2.) Would the AME definitions interfere with this? Or vice-versa?

I'll wait a bit.

final kaoss
11-06-2013, 02:19 AM
The js I was referring to was this.
https://labnol.googlecode.com/files/youtube.js
So yeah like the guy stated, if you run a high traffic site, please host it locally lol. Sorry if I wasn't clear enough but that's the js that you want to save & upload to your host.

Max Taxable
11-06-2013, 02:37 AM
The js I was referring to was this.
https://labnol.googlecode.com/files/youtube.js
So yeah like the guy stated, if you run a high traffic site, please host it locally lol. Sorry if I wasn't clear enough but that's the js that you want to save & upload to your host.That clears that one up... But I use AME so I am leery about any embed changes ya know?

final kaoss
11-06-2013, 02:41 AM
Well simply put upload the file and then, add this to the footer template of a theme at the very bottom.
<script src="http://site.com/youtube.js"></script>

Thats it! If you have any ill effects... just remove that line & it's reverted.

tbworld
11-06-2013, 02:49 AM
Very interesting @final_kaoss... Thanks for sharing. ;)

Max Taxable
11-06-2013, 02:53 AM
Well.... Turns out I already have a file styled "youtube.js" on my server. Wondering if that is a AME file...

final kaoss
11-06-2013, 02:57 AM
Nope, it doesn't appear to be from AME. Just checked it's 6 files & 7 folders.

Max Taxable
11-06-2013, 02:58 AM
Nope, it doesn't appear to be from AME. Just checked it's 6 files & 7 folders.Yep i just renamed it "youtube_old" and it had no effect, and uploaded the new one. Installing the call for it now.:)



UPDATE: This had no effect at all, apparently AME overrides the call.

ANOTHER UPDATE: "Hey dummy, change the "site.com" in the call, to your actual domain where the js file is located!" :D

Seems to have made it faster in threads with a bunch of videos, otherwise no change. All embeds are still there and everything still works right, can't see any harm done.

I have the call installed on the footer of only one style, so i will test that and a style without, on webpagetest and see if there's a change in the kb loaded.

--------------- Added 1383711077 at 1383711077 ---------------

FINAL UPDATE...

NO difference at all on kb loaded or pageload speed with and without this addition, while using AME.

--------------- Added 1383716246 at 1383716246 ---------------

Here's two identical tests at webpagetest dot org, with same browser, same location, same connection and only minutes apart. The first one is with this addition:

https://vborg.vbsupport.ru/external/2013/11/17.jpg


The second one, without:

https://vborg.vbsupport.ru/external/2013/11/18.jpg



I am using AME, and all this did was add six requests... and three bytes.

smirkley
11-08-2013, 08:25 PM
Not using AME, but I gave it a try, remotely as well as locally.

But no change in pageload speed or pageweight.

Quite honestly, I could not find any change of operation.

Unless I missed the obvious....