[Geek] Embedding Youtube videos are slowing down my site

Share post ->

On Friday, I did a speed test on my website.   This was my score.

2013-09-08_2131

 

Compare to when I just launched my site, there was a huge increase in requests, load time and page size.  Obviously the site at that time had no content.  It was fast and speedy.

As I dig deeper, I noticed that most of the requests are coming from embedded Youtube videos.  It appeared that in order to embed Youtube videos, the blog is pulling flash files (swf) and Javascript files (.js) from Ytimg.com (YouTube Property).  It is pulling files to load that it might not be use.  In order words, it is taking up time to load something that we might not use.

extra-request

Another problem I noticed with embedded YouTube videos is that they are not mobile friendly (or responsive).

Here’s how it looks like on my phone:

Screenshot_2013-09-06-17-23-44

Noticed how the video sticks out from the rest of the blog.

So we have two problems with Youtube videos:  They are slow to load and they are not mobile friendly.
Looking online, I found a plugin that fixed both of these issues.  It is called WP YouTube Lyte.  I loaded the plugin and made minor changes to my YouTube videos.

WP YouTube Lyte only loads the YouTube files when you click on them.  This reduced the number of requests and loading time tremendously.  The plus side is that it is mobile friendly (responsive) as well :).

It is nice to kill two birds with one stone.

Website speed test after

after-clifftam

I know my score has gone down.  I added a few more plugins and had a few more Javascripts on my blog.  I will figure out how to merge them together 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

If you are bored :-)

Cliff lying down with his baby daughter. It is a thumbnail for a blog post.

The Painful Tension Between Ministry and Family

There was a season when Wai Jia and I attended a missions conference with our two-year-old and our baby. We have always loved missions, so being there stirred something in me again. I remember sitting in that environment and feeling the old desire rise up in my heart. I wanted

Cliff with his two daughters. One is a baby and the other is a toddler.

Confession of a Stay-At-Home Dad

A Biblical Vision for Christian Fatherhood I never planned to become a stay-at-home dad. If you had asked me years ago what faithful Christian living looked like, I would have said ministry, missions, or serving in church. Not changing diapers.Not managing tantrums.Not slowly climbing stairs with two little kids. But

When Your Wife’s Calling Is Bigger Than Yours: A Christian Husband Reflects

What happens when a husband feels like his wife’s calling or career is bigger than his own? Many Christian couples quietly wrestle with this question, especially as they seek to understand the biblical roles of husband and wife. Recently, a friend asked me a question about marriage, work, and calling.