Blog

15 ways to speed up your website


Android vs IOS

Having fast website is crucial not just for ranking well with Google but for keeping your profits high. In this article, we will teach you how to make your website load faster.

Having slow website is a big headache for any business. “Patience is a virtue” does not apply online. Even as a user or as a business owner slower website is not at all beneficial. In this era of Google ranking, even one second delay can reduce your page views, drop conversion, and traffic as well as customer satisfaction.

According to a Strange Loop case study:

One second delay in page load time can lead to 7% loss in conversions, 11% fewer page views & 16% loss in customer satisfaction. There are many case studies showing benefits of having a fast website. A fast website can improve overall quality and increases user experience. Speed can make or break your website. Because slow speed kills conversions.

Improving site speed improves performance of website too. The best example would be Walmart. They worked on their website speed and surprisingly their conversion and revenue increased drastically. How can you test your website’s speed? There are many website testing tools, which can help you to analyze your website speed. Some of the most popular and useful website testing tools are given as under:

1 Google’s page Speed Insight

This is a free tool offered by Google to test your website’s speed. All you need to do is enter the URL of your website and this tool will analyze your content & will suggest you to make changes to boost website speed.

2 Webpage test

In this test tool, you can simply test website's speed as well as you can perform advanced testing including – content blocking, multiple transactions, video-capture and much more.

3 Yslow

Yslow is a useful tool to test your website speed. It will guide to improve website speed.    

Apart from these tools, there are many effective tools online like SOASTA, PingdomWeb load, GTMetrix and Neo load. After testing your website speed you will come to know that following factors affect the performance of website's speed:

-    Size of individual files

-    Large high-resolution images

-    More HTTP requests like – CSS style sheets, scripts & HTML files.

By making adjustments in coding, images, and layout of a website you can boost website speed. Today we are going to share some tips with you to improve site speed. So that users can have better experience.

1 Images

Must remember following tips to increase website's speed:

-  Keep image size under 150KB. Compress all images for web-based quality. You can compress the image using “Save For Web” & you can also use the default image compressor built into Google’s Page Speed Plugin. Another online compressor tools are also available such as tinyjpg and compressor.io.

-  Use the right image format for your website. Test formats like PNG, JPG, GIF, or SVG. Choose the lightest format to upload.

-  If your images are large in size, then they will take more time to load. For example, if the actual image size is 800 x 800, you can scale it down to 100 x 100 pixels. By scaling down your website can be faster than before.

- Remember don’t scale down images with CSS. Because your browser will load those images at full size only.

- If you are using WordPress, install the WP Smush.

- Avoid empty image src codes.

2 Browser Caching

You might have observed that if you revisit any webpage then the content, images and other data will load faster than before. This is because when you revisit a website, the elements of the page are stored on your hard drive in a cache. You can add expires headers to leverage browser caching. As expires headers tell the browser whether to request a specific file from web server or whether to get a version of a page from the browser’s cache.

Expires headers helps you in two ways:

1 It reduces the number of HTTP requests that need to be made.

2 It also reduces the need for users to download same files from your web server twice.

How long you store the data depends upon users’ browser configuration and your server-side cache settings too. Enabling caching can shave off a significant amount of time of returning visitors. You can use following code to your .htaccess file.

## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 1 month"
</IfModule>
## EXPIRES CACHING ##

3 Minify HTML, CSS & JAVASCRIPT

HTML, CSS & JavaScript are important files of your website. They add to the number of requests your site makes every time users visit a website. You can reduce the number of requests by minifying or combining files. Messy codes can slow down your website. Compressing & merging CSS removes unnecessary characters, comments, and rules from your stylesheet. CSS loads before people see any website. If your CSS file takes much time to download then users have to wait to access the content of a website. How can you minify your CSS file? Following are the simple steps you need to follow:

-    The first way is to get rid of unnecessary codes from your file

-    Check if your CMS minimizes your CSS or not.

-    You can use online tools like CSS Minifier & CSS Compressor.

Just like CSS you can also minify your HTML files. You can remove unnecessary characters such as empty tags, comments and whitespace characters. To minify JavaScript’s code, you can utilize an online tool such as JS Compress. If your site runs multiple CSS & JavaScript files then you can combine them into one. To conclude, if your file consist few elements then the browser will make few HTTP requests to make the page render.

4 Enable Gzip Compression

Gzip is a file format and a software application used for file compression and decompression. Make sure that your web server has Gzip compression enabled. Compression can dramatically reduce your page’s size so that your website speed can be increased. Enabling Gzip Compression is the best & effective method to minimize HTTP requests and it also reduces response size by approx 70%.

According to Yahoo, 90% of today’s internet traffic travels through browsers that claim to support Gzip. You can enable Gzip by adding following code to your .htaccess file:

# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
# Or, compress certain file types by extension:
<files *.html>
SetOutputFilter DEFLATE
</files>

5 Improve your hosting plan

While starting out most people go with cheapest hosting plans. They use shared hosting. If you are one of them then in long run you will notice that shared hosting will not be very beneficial. If you provide excessive content then your website’s speed will slow down. To stop your website from slowing down the best choice would be to upgrade your hosting plan. You will have two options: VPS hosting and dedication option. Both options will increase the speed of your website. According to your business need, you should choose required hosting plan.

A quick tip

While deciding a hosting plan – go with VPS (Virtual Private Servers). Because VPS uses multiple servers for content distribution. It is useful for those developers who run resource - intensive websites. VPS is cost-effective option compare to dedicated hosting.

In case of dedicated servers, it is like owning a big computer. In dedicated servers, you will have full control over all resources. You don’t have to share RAM, CPU & bandwidth. But keep in mind dedicated servers are expensive in comparison to VPS hosting. Also, dedicated servers are less flexible.

6 Reduce unnecessary plugin

Yes, you read it right. Although plugins help you to get rid of messy codes. But some of the plugins can slow down your website,can create security issues and sometimes plugins can cause crashes too. Evaluate all the plugins you have installed so far. Some of the plugins will be outdated, inefficient and incorrectly configured. These types of plugins will decrease the speed of your website. If you want to identify which plugins are slowing down your website then you can utilize a tool named P3 (Plugin Performance Profiler). This tool will diagnose the performance of each plugin used on your website.

Remember it doesn't matter how many plugins you have installed. It’s possible that your website has more than 60 plugins and still your website will still load faster. In contrast, you have only 10 plugins installed and still your website will run slow. The point is it's not about the number of plugins it's about quality of plugins that matters. So from now on avoid using plugins with long scripts and lot of style. Keep those plugins only which are extremely necessary for you. Eliminate those plugins of the tasks you can perform manually.

Each plugin is installed for the specific purpose. Find those plugins which can be useful for more than one purpose. Evaluate features of chosen plugins and select the one which offers many features in one plugin. For example, the WP Rocket plugin & WP Total Cache plugin both are very useful for improving site speed. Both plugins have somewhat same features. So you don’t need to install both plugins.

7 Minimize redirects

Having too many redirects in your website can have a negative impact on website’s speed and performance. Because many redirects create additional HTTP requests and add latency. 301 error or 404 errors are not ideal for your website. To identify redirects in your website you can use a tool named Screaming Frog. Run your website scan and keep minimum redirects only. While scanning your website - look for redirect chains too. Because redirect chains create unnecessary requests which will slow down the download time.

 Google has recommended some tips for redirects given as under:

-    To get a given resource never use more than one redirect. For example, if your target page is C. There are two different start points A & B. Both A & B should redirect to C only. A should never redirect to B.

-    Never reference URLs in your pages which that are known to redirect to other URLs.

-    Minimize extra domains that issue redirects but don’t serve content. Sometimes people get tempted to redirect from multiple domains to reserve namespace. By this you give users the idea that they can reach your site from multiple URLs. At the end, you will wind up in a costly cycle of buying new domains. I suggest you that don't follow this practice just to stop cybersquatters from taking over your name.

8 Reduce external scripts

Your website will be having many external scripts in a form of JavaScript & CSS. These both files will often generate many HTTP requests which will slow down the performance of your website. External commenting systems, like my page box, social media boxes, pop-up boxes and external fonts - these are some common examples of external scripts on your site.

Always remember the fewer requests your website makes, the faster your page will load. How can you identify external scripts on your site?

-    Re-open the network tab in chrome

-    Go to developer tools

-    Go to sources & check

For example, if you are using Gravatar for comments, it will also generate requests. Same goes for twitter sharing post and other social media sharing plugins. Knowing which features are affecting your website load times – will help you to understand your site’s speed. If your website contains videos and multimedia files from other slow websites then your site’s speed will also have a negative impact. Make sure whenever you request external files – those files would be taken from fast and reliable sources. Don’t exaggerate requesting external files on your site.

9 Fix broken links

Scanning your links on regular basis and fix those links which are broken should be your priority.  Broken links stop your site to give better experience to users. If your CSS, JavaScript or image URL consist any broken links then it will affect your site’s speed. You will come across many broken links in image source files. When URL is wrong, broken links take place on your site. When there is a broken link in your image, your site will show 404 error. This error will slow down your site. Due to this error user will not be able tto download images on site.

Broken links are also found in CSS file. If your CSS file is having any broken link then it will generate useless HTTP requests which will result in 404 error. If your site contains many external CSS files, keep checking to find broken links.

Suppose that your site involves broken links then one easy way is to put your JavaScript at the end of your HTML document. If browser generates 404 error page rather than JavaScript all other downloads stop. If your JavaScript source URL consists of broken links then a browser will try to interpret JavaScript which will lead to increased download time along with bad script interactions. Broken links in any of your script will slow down your site’s speed.

There are many online tools out there to check for broken links such as:

-    Online Broken Link Checker

-    WordPress Broken Link Checker

-    Link Checker

-    Google Analytics

Sometimes these online tools can’t catch broken links. To gain complete surety check your server logs regularly. You can even create a report for broken links. Keep a record of the changes you have made. Keep analyzing data so that redirecting of broken links become possible.

10 Clean up your database

One of the many issues developers come across is having piled up unnecessary database. Your database can get very messy due to deactivated plugins, post revisions, saved drafts, images, pingbacks, trackbacks, and external links. These type of problems usually occurs in e-commerce site due to many orders. If the database increase, your website will become slower. To maintain site’s messed up database focus on following tips:

-    Use WP-Optimize plugin. WP-Optimize is an effective tool for automatically cleaning your WordPress database so that your website runs efficiently.

-    Remove older installations of WordPress on your server.

-    Use WP–DB Manager & WP-Sweep.

-    Backup your files first before cleaning database.

11 Enable Keep-Alive

Keep-Alive is also known as HTTP Keep-Alive or persistent connection. It is a connection between the client machine and web server asking for permission to download specific files. According to Wikipedia,

“A keep-Alive signal is often sent at predefined intervals and plays an important role on the Internet. After a signal is sent, if no reply is received the link is assumed to be down and future data will be routed via another path until the link is up again. A Keep-Alive signal can also be used to indicate to Internet infrastructure that the connection should be preserved.”

Enabling Keep-Alive will help you to save bandwidth. Though most hosting companies disable this feature. HTTP Keep-Alive allows TCP (Transmission Control Protocol) connections to stay alive and it also helps to reduce the latency for subsequent requests. To enable Keep-Alive simply copy paste following code in your .htaccess.file –

<ifModule mod_headers.c>

Header set Connection keep-alive

</ifModule>

12 Reduce DNA lookups

DNS – Domain Name System is like a phonebook for the internet. It is a server with a database of IP addresses and their host names. When a user types URL in a browser, A DNS server translates that URL into IP address that indicates its location online. There are many factors that affect how quickly your page loads – such as how much amount of time your DNS lookup takes. Because a browser can’t do anything until DNS lookup is complete. You can check your DNS lookup time by using a tool named Pingdom. If your DNS provider is not being able to provide enough speed then change your DNS provider to get the faster result. One way to reduce DNS lookups time is to sprite your images. Put together those images which are loading on every page of your site.

13 Use a CDN (A content delivery network)

"A content delivery network (CDN) is a collection of web servers distributed across multiple locations to deliver content more efficiently to users." Whether we know it or not every one of us interacts with CDNs on daily basis. A CDN is another way to reduce server lag by storing static resources on a network of fast loading servers.

Because of CDN, the requested web content will be delivered to end users quickly. CDN will use a server closest to users to deliver the files they request. By using CDN, you will save a lot of bandwidth. Also you will be able to improve your page load time and website speed. For example, a user from the United Kingdom visits your site, the browser will download files from a nearby server. Using CDN will eliminate loading lags and latency issues. You can store your CSS and JavaScript files on CDN. CDN can be very expensive. Though CDN is a power pack consisting many benefits so it’s worth it to spend money on CDN. If you want to start using CDN, consider MaxCDN & Cloudflare as best options. MaxCDN offers CDN service. They only focus on improving load time.

14 Change your website theme

Website’s appearance is very important for any business owner. Some beautifully designed themes might tempt you. But before finalizing website theme check out the speed of theme by using one of the tool of website speed testing. Because if your website consists complex code then your website might take much longer time to load. Don’t just look at aesthetics of website – your priority should be speed and performance of the website too. Even if your server configuration is good enough website themes with complex codes lead to slowing down your site speed.

15 Server response time

What is TTFB? – It stands for Time-to-First-Byte. It is an important metric that measures the responsiveness of your web server. TTFB measures the duration from the user making HTTP request to the first byte of the page being received by the client’s browser. As soon as a browser receives the first byte, it can start downloading. During this time browser can’t download anything, this may have an effect on your site speed. The longer your server takes to respond, the later the page will be shown. Web Page Test stats that a TTFB should not exceed 0.5 seconds on an average. To monitor your TTFB you can use many online tools such as bytecheck. It is a useful indicator to test TTFB.

Conclusion

Having faster website is an absolute requirement to grow your business and presence online. These all tips will help you to speed up your website as much as you desire. But remember you don’t need to implement above tips all at once. Test your website by utilizing above tools mentioned and decide the factors that you need to focus on immediately. take actions accordingly. Today’s internet users are impatience like never before. They need result in a blink of an eye. To keep up with your users’ expectations start working on speeding up your website from every aspect. And yes, don’t forget to back up your data before implementing above tips.

I hope that you find this article useful. After reading this article you are all set to speed up your website. Which tip you found pretty useful for your website? Let us know in a comment box. Your say matters.

Author Details


blog

Gaurav Patel

Gaurav Patel is Founder of thirstyDevs InfoTech
thirstyDevs InfoTech is a Web solutions company offering innovative web solutions. Our company focuses on providing the best web solution for our customers.




Success In Numbers

120

Happy Clients

182

projects completed

8,100

Hours Worked

Contact

Give us a call
Send us an emailGaurav@thirstydevs.com
Visit us for a coffee313 - Esconplaza,
Amroli, Surat - 394107, Gujarat, India
Get in touch