To create great user experience. If your website loads fast, your visitor will stay longer and won’t click back to visit your competitor. And because creates great user experience, now search engines are measuring your website speed and consider it a factor to rank well in search engine results. A slow website will not have good search engine positioning.
Factors affecting your website speed
Code
Javascript, css, xml, html, etc. The way your designer coded your website affects its speed. The amount of functions, order of styles and optimization of these. Your website is formed of dozens or even hundreds of files, if the code is not inserted in the correct file, it will affect the whole site. The web design for your website should be done optimizing code.
Images and other media
If they are not optimized, they’ll affect the loading time of your website.
External resources
Sometimes your website needs to access external resources, scripts, fonts and others to work. There’s a right way to call these external resources in order to not affect your website speed.
Web hosting
If your server where your website is stored, is slow, of course will affect your website speed too. Using a CDN, or Content Delivery Network, will help your website to be accessed faster from any part of the country, or the world.