Slow-loading websites are one of the main reasons that visitors may leave a site. As a result, it is important to ensure that your website is fast and regularly make improvements as content changes. (For information on determining whether your website is slow, see Is My Website Slow?.)
Our list below gives 32 methods to minimize your load time.
While your files may be very readable, line breaks and spaces greatly inflate the size of your files.
Usually, similar style information is used to display each page in a website. By using external stylesheets to store this information, users will realize faster page loads.
Similarly, it is also a good practice to place all scripts in external files.
Dynamic websites spend time querying a database every time a page is loaded. Clearly, it is unnecessary to do this for every page. To save this time, consider implementing caching or generating static documents.
Images usually account for a website’s slow response. Try optimizing your images by reducing the quality, opting for a different image format, or cropping/resizing. (See Image Formats: JPG, GIF, and PNG or 6 Ways To Optimize An Image for more information.)
CSS enables websites to be built with shorter, simpler, and faster-loading code. (See 6 Reasons To Avoid Using Tables In Website Layouts for more information.)
If you display advertisements on your website, you may notice a decrease in load speed. Consider minimizing the number of advertisements or opting for HTML — as opposed to JavaScript — ads.
Most rollovers are accomplished using Javascript or some other technology. Instead, consider using CSS.
One common error is the use of large backgrounds. If you must use an image, try to minimize the dimensions and tile the image by using CSS.
Sometimes, CSS can be used to get rid of images. For example, use CSS for backgrounds, lines, and borders.
Flash documents are often very bulky, often requiring a preloader, and many seconds to download. If you do not want to remove flash, consider finding ways to minimize the file size. (See Why Flash Might Not Be Good For Your Website for more information.)
If your website is slow due to a large number of images, consider removing some.
There are many things that dynamic scripts can accomplish: uploading, emailing, writing to files, retrieving remove content, and more. If done improperly, these scripts will take a long time to accomplish their function. Consequently, it is important to make these scripts as efficient as possible.
If you have a dynamic website, minimizing calls to a database, as well as optimizing queries will increase the speed of data retrieval.
Sometimes load time has little to do with the website. Be sure to verify that your web host is not slow. And if necessary, be prepared to move to a better hosting service.
Sometimes its very quick to write an inline style in a div or table. However, it is a better practice to use IDs or Classes and separate style information from content.
Perhaps you have too much content on one page. If this is the case, consider removing content or dividing content into multiple pages.
Every time a web page links to external information, such as images, javascript, or css fies, the page load time increases.
To reduce the number of HTTP requests, you can remove images or combine them. For small images, for example, it may be preferable to use image maps.
You can also consider combining files. This can be done by combining CSS and JavaScript files.
Inline images are those that are referenced in HTML pages. To minimize inline images, consider referencing them in stylesheets.
Believe it or not, the closer your server is to your visitors, the faster it will be for them. If you run an international website, for example, consider using a server in that country.
Gzip, which is the most popular and effective compression method, can be easily added to web pages. It is also supported by most modern browsers.
The bottom of documents are ideal locations for JavaScript. However, this is not always possible, depending on the functions in your scripts.
In addition to removing whitespace, shorthand notation is another way of optimizing CSS files. (See 5 Common CSS Mistakes for more information.)
Redirects are very slow.
Sometimes, urls linking to folders are not given using the trailing slash. And while this does work, it is slow. Behind the scenes, a 404 Error has been generated and a speedy redirect takes place. To avoid this, simply add the trailing slash when linking to folders.
Not all Javascript needs to be executed immediately. Consider delaying some scripts and dynamically loading them after the entire page has loaded.
The most common use is for advertisements or embedding external web pages. Consider minimizing the number of iframes per page.
The link tag is more effecting way of linking to external stylesheets.
Instead of using the height and width attributes to scale images, you can reduce the file size by resizing images.
This will help you to avoid generating 404 - Not Found errors. (See Favicon - What is it? for more information.)
Of course, not every page can load quickly. For example, if your website has high-quality image galleries, those pages will load slowly. However, to keep your users and bait them to explore your website, it is important to optimize as many pages as possible.
Tags: cache, CSS, favicon, frames, gzip, image optimization, JavaScript, load timeTrackback URL for this entry:
http://www.velvetblues.com/web-development-blog/32-ways-to-speed-up-your-website/trackback/
Contact us today for a quote. Click here to submit details regarding your project.
If you are making a general inquiry, send an email to info@velvetblues.com
Awesome. Also, you might want to try apache worker module.