Lazy Loading Youtube Videos

Fri Jan 11 2019

Background

The concept of lazy loading is a design pattern where you only download the required scripts/content when the client needs it rather than when the page is loaded. The most iconic example is the “infinite” feed that social media sites like Instagram use. Rather than dump a ton of content to the client at once, Instagram dynamically loads more content once you reach the end of the page. This allows websites to save bandwidth by only sending the client what they need when they need it.

When a youtube video is embedded into a website, it pulls a ton of scripts which are required to play the video. However, when you embed a youtube video on a blog post, most people are not going to watch that video. Even if the visitor wanted to watch that video, there is no reason why all the scripts should be loaded when you initially land on the page. Rather than embed the video normally, you can instead simply have a the thumbnail of the video with a play button on it. When the client clicks the play button, the youtube scripts are then loaded.

Performance Without Lazy Loading

Node Website Optimization

Sun Jul 22 2018

It is a well-known fact that a fast website is critical towards having high user retention. Google looks favorable upon websites which are well optimized and fast. If you are using a CMS like WordPress or Wix, a lot of optimization is done automatically. If you like to build stuff from scratch like me, there is a ton of work required to optimize a website. This post will cover the 8 things that I did to decrease the load time of this blog written in node by two seconds.

Final Results

Final Website Speed Test

This is the result for a single blog post.

Node vs PHP

Wed Feb 07 2018

PHP vs Node meme

It used to be the case that you wrote PHP for the backend and JavaScript on the front end. However, that has all changed with the invention of Node.js. Some kid invented a clever way to run JavaScript on the server. Now we can develop a website that runs JavaScript on both the front and back end. This is good right? We should all learn JavaScript. The one language to rule them all. Although Node.js has taken the web by storm, I would argue that there are cases where PHP is still relevant and even preferable.

Where PHP Wins

The major benefit with PHP is the low development time. You can write a website in PHP much faster than you could with Node.js. PHP is simply easier to work with than Node.js. Things like GET, POST, and SESSION information is simply a variable that you reference. Doing the same things in node.js is trickier because they require node dependencies – which vary in quality. Next, PHP was built to work nicely with databases like Mongo, and MySQL. In PHP you can make database query without falling into the callback hell that you experience in Node.js. It is not impossible or impractical to work with databases in node.js, I have done it plenty of times. However, synchronization of the database calls can be tricky and requires more code than it does in PHP.

Why I Stopped Using WordPress

Sun Feb 04 2018

WordPress currently has a bad reputation on the internet. Many people argue that the technology WordPress uses(PHP) is out of date. Tons of people leave WordPress for sites like Wix and squarespace simply because they are easier to use. There are valid points to these arguments. However, I would like to argue that WordPress is honestly not that terrible. There are hundreds of themes and plugins which make WordPress a very robust platform to use. Content management on WordPress is also very easy to manage. It may take more time to set up a WordPress site; however, it is well worth it in the end. WordPress is definitely not the solution for every website, but it is still adequate for blogs.

I did not leave because I hated WordPress, I left simply because I wanted to build something of my own. This blog has been deserted for several years and I decided that it was time to bring it back to life. I decided to totally recreate my blog using Nodejs from the ground up. Going into this endeavor two weeks ago, I knew absolutely nothing about Nodejs other than it was a JavaScript framework for back end web development. I knew a fair amount of JavaScript, so the project went smoothly except for synchronization bugs. Going from PHP development to a Nodejs development took some transitioning, but in the end, I think it was well worth it. I will write a post about the differences between PHP and Nodejs in the future.

History Of Jrtechs

Sun Feb 04 2018

Original Site

Jrtechs initially started as a static HTML site that I created early 2014 to build my HTML skills. I initially chose the name Jrtech, but that name was taken so later changed it to Jrtechs. My old computer running ubuntu 12.04 hosted this website. This website went though a lot of revisions as I learned more HTML/CSS. When every you opened the webpage, the images slowly appeared since I was hosting it on a DSL connection. This website never got any real traffic since it mostly just hosted a few pictures of projects I was working on. My vision for this website was just to be a place where I hosted projects that I was working on.

Original edgy site

Move to WordPress

In 2015 I moved my website to the cloud and started a WordPress site. The website was focused on turorial like blog posts.