How to Optimize Your Website for Speed

Do you feel like your website is stuck in first gear? Does it take forever to load the homepage and other landing pages? We'll talk about several different bottlenecks that cause these kinds of issues and how to optimize your website for speed. If you don't feel comfortable fixing them yourself, email us at [email protected] or give us a call at 918-544-2500 and we'll be glad to help!

Your Hosting Plan

If you're getting 500 visitors a day, it's probably time to move off that shared hosting plan and move to a VPS (Virtual Private Server). This allows you to have your own virtualized server and it comes with more processing power, RAM, and a full array of customizations. You will have your own operating system, bandwidth, and disk space. Once you get on a VPS plan, you can upgrade to the latest version of PHP, if you’re not already on it, which includes memcache. This is particularly advantageous if your site is PHP-based. Instead of PHP scripts being compiled in real time, slowing down your website, it will compile your scripts beforehand and they are ready to be served to your visitors. Check with your hosting provider about upgrading to a VPS. If you're not sure whether it's time to upgrade to a VPS or not, contact us at 918-544-2500 for a free consultation.

You're Not Using a CDN

A CDN (Content Delivery Network) is exactly what it sounds like. It is a separate network that delivers content. For example, CloudFlare is a CDN that offers free and paid plans. You can bet that they have a much better infrastructure and network than your hosting provider. Many CDNs offer optimization services such as minification of CSS, JavaScript, HTML, and images. Using a CDN is also advantageous if your current hosting provider is located in California, but all your web traffic is coming from New York and London. The network latency between those visitors and your server in California can be quite high. Since a CDN caches all of your static content across multiple servers across the U.S and the world, your visitors will experience faster loading speeds. Check out our in-depth article on CDNs: 5 Reasons Every Web Developer Should Be Using a CDN.

Common Design Mistakes

1. You have render blocking CSS and JavaScript in above the fold content. There are certain situations where this is unavoidable, but often times scripts can be moved to the bottom of your source code so they load last. You can also add a defer tag which will tell the script not to execute until the page has finished loading. There is also an async tag for external scripts which will load them asynchronously with the rest of the page.

2. Your images aren’t optimized. This is a common mistake I see with a lot of websites. A previous client had 9 MB of data to load for a simple front page. After looking around, it was fairly easy to see the images were 2 to 3 MB in size. You can use Photoshop to correct this by clicking on File, Export, and Save for Web. GTmetrix allows you to run a scan against a website for common speed issues and even provides the optimized images you can download and replace to fix the problem.

3. You are relying on too many external sources. Sometimes it’s nice to use Google Fonts in our code to simplify everything and provide cross compatibility between browsers. However, if you look at the waterfall chart on a page with Google Fonts, you’ll see a few extra DNS lookups and sometimes a 200ms response time for each call. This can add up pretty quick and cause a delay in your website. For one client that was using Google Fonts, I removed the external calls from CSS, downloaded the fonts to the server, and then pointed the calls in the CSS to the local server instead of Google’s server. Just this one thing alone reduced the website loading time by one second and since the fonts are a static resource, that means they are also be cached by your CDN for you and add another speed boost.

4. You don’t have compression enabled and aren’t minifying your resources. Any modern browser will support gzip compression. This can reduce the size of the response up to 90%. If you don’t already know, minification reversing the process of removing any data without affecting how it’s processed by the browser. This is especially important with your HTML, JavaScript, and CSS. Removing unnecessary whitespace and comments can save a lot of bandwidth and reduce the time it takes for your page to load.

Final Words

Studies have shown that most visitors will leave the website if it doesn’t load within two seconds. You can also be penalized by Google in your SERPs (Search Engine Results Page) for slow loading websites. If you want to track these down on your own, start with Google PageSpeed Insights and GTmetrix. Using these two tools alone, you can fix many problems plaguing your website. We offer website and SEO optimization if you want this done for you. You can email us at [email protected] or give us a call at 918-544-2500.

How to Optimize Your Website for Speed | NexaCore IT | 918-544-2500