Here’s a matter of fact, the average website user is impatient. If your website is too slow to load, they will go elsewhere. There are many factors that affect the speed of your website. The most basic thing you can do to help assure your pages load quickly is to choose a quality hosting company.
The old adage, “You get what you pay for,” is even more true today. That cheap hosting company may be cutting corners on equipment in ways that will affect the reliability and speed of your website. Before you choose a hosting provider, investigate their hardware. They will probably list it somewhere on their website. Good equipment should be a strong selling point for them. If you cannot find a list, ask their sales or support team. They should be happy to give you the information.
Once you are sure that your hosting company is the best you can afford, there are other things you can do to improve your load times. Even though speed is sometimes affected by outside factors you can control many issues yourself.
1. Web Hosting Speed: One other factor to consider in choosing your hosting company is the bandwidth providers they use. You can check to see what providers your current host is using by running a trace route test. On most Windows systems, click on “Run” in your Start menu, then type CMD into the window that comes up. This will give you a command line window. Type in: “tracert”, without the quotes, and the URL to your website to see how many hops it takes to reach them and what providers they are partnered with along the way. Mac and Linux systems offer a version of the same process. On a Mac, the path is “Applications”-> “Utilities”->“Terminal”. Type traceroute and the same URL. On a Linux, system simply open a command prompt and type in “traceroute” and the URL. If you are running Ubuntu, go to “System”->”Administration”->”Network Tools” to find the option.
2. Server Location: Most large hosting companies have more than one server location. Take into consideration where the majority of your users are located and ask your hosting company to move your files to the server that is closest to them. You can run a “ping” test from the same command window used for the route test to see how long it takes for contact to be made. If it is more than 40ms (milliseconds), check into having your files moved closer.
3. Hotlinking Parasites: One factor most people are unaware of is the practice of linking to video, music or image files on your website by another website owner. If you are the victim of this, the other person is robbing you of bandwidth as they pull those files for use on their website. To determine if this is happening to you, check your logs. If social networks such as Facebook show up in the referrer log or you see that an image or other item is frequently being served without the page it is on, you will know it is hotlinked. To stop this, you should be able to turn on “hotlink” or “inline link” protection at your hosting control panel. However, an independent method you can employ is to create an .htaccess file for preventing other websites from using your files.
4. Ready Cash: Another helpful trick is PHP server side caching. Enabling caching of your PHP files means that once your visitor has loaded a page, it is saved and stored as a static HTML file so that the server won’t have to constantly run the query and compile the PHP pages. This will allow the pages to be loaded faster. If, like many people, you are using a blogging application, such as WordPress, to manage your site, there are plugins for caching. If not, ask your web host if they offer an application such as Zend Optimizer to increase PHP performance.
5. Cluttered Database: In addition to PHP bottlenecks, poor database maintenance can slow down the loading of your site pages. There are probably hundreds of database optimizers available. WordPress offers a plugin called WP Super Cache for those who use their framework. Joomla, another popular content management system, offers several extensions for improving performance or simply use your database cPanel to access phpMyAdmin and click the table icon. Then, find the “Check all” link and select “Optimize Table” from the drop-down menu.
6. Optimized Images: A picture really is “worth a thousand words.” An image on the page is the first place a visitor’s eyes go. A page without graphics is simply not as interesting to look at and most people find a screen full of text too intimidating. The problem is that images take longer to load than text and too many graphics may cause significant load problems. However, large, professional websites using dozens of images on their homepages still load quickly because the graphics are optimized for the web. Optimizing images is not difficult. All it requires is a photo editor that allows resizing. Web images should be saved as either JPEGs or GIFs. (PNG format is good, but sometimes it can result in a huge file.) They should be sized to fit the space before uploading. A photo that is 8×10 inches at a resolution of 300 pixels/inch is print quality. The system must re-size it because such a large picture will not fit on the average screen. Graphics for the web should always be sized to no more than 650 pixels on their longest side and they do not need a resolution of more than 75 pixel/inch. The size reduction will make a huge difference in load times without affecting the visual impact.
8. Tidy Stylesheets: Along the lines of reducing code size is to constantly update your CSS files. As you update your pages and change font sizing and colors, the CSS code for those old styles stays in your page, leaving many CSS elements that are no longer needed. Keeping your CSS files as small as possible can help reduce the time it takes your pages to load. This practice also makes your CSS code easier to read if you need to troubleshoot.
Making the time and effort to clean up your pages can insure that you run a lean, efficient website. Along with choosing a good hosting company, optimization is one of the most important things you can do to make your website successful.
This is a guest article by Brian Flores of InMotion Hosting. Brian Flores is a SEO and copywriter for InMotion Hosting, one of the top dedicated server providers in the country. He works with a team of awesome writers to post useful tutorials on WebHostingHelpGuy. You can follow him on Twitter @WHHG_InMotion or @BrianAFlores.