PDA

View Full Version : [HTML] Reducing the load time of your website!



properclone
05-03-2005, 09:40 PM
Hey, Here are some tips on reducing the load time of your website, if you have any ideas you can contact the mod(s) of this forum to add it!

1. Instead of having any css straight on your page using <style></style> attatch it!
First create a .css file and put in all your css code, then save it and put this before </head> in your site's code (Change the path in bold):


<link href="mycss.css" rel="stylesheet" type="text/css">

This can also be done with JavaScript. Just paste your code into a .js file and attatch it with this code before the </head> tag on your site (Change the path in bold):


<link type="text/javascript" href="myjavascript.js" >

2. If you are using a layout that you sliced, don't use background images that are just one plain colour, set it as a colour. This is obvious but i've done it before as a force of habit!

3. Use more CSS than HTML. For example:

Use:
body {
background-colour: #000000;
} in CSS.

Not:
<body background="#000000"> in HTML.

Homesrfan
05-03-2005, 10:26 PM
Hm... dont know if this is good enough to sticky yourself for.
But I'll give you something for your work...
Rep.. I guess.

Mentor
05-03-2005, 10:31 PM
I wount suggest it, it can somtiem slow the loading time down if a person is not casheing the data (on some browsers / settings)

plus if you have a glitch in laoidng you can load a page without its css, wich tends not to give the most pleasant results, as well as this, it doesnt realy speed it up, it loads the page, and then ads teh effects on once its loaded, wich can be annoying as it can cause the page to jump. the only time it could be recomnened is if your trying to save boared wrapper space on some forum hosts like IF.

Athogh if your calling alot of elimnets over and over the css will speed it up, but one off the will have littel to no effect, its more teh page size that has teh effect but css is better anyway as u can do laot more with it.

-JT-
08-03-2005, 07:42 PM
the most effective way to boost the loading time is to optimize the images "/

Mentor
09-03-2005, 06:07 PM
if you have php gziping the pages can be an idea, can siave up to 70% band width per load, and has slighty faster page genrtion time. Plus is very easy to add in.



<?php
ob_start( 'ob_gzhandler' );
?>


just ad that to the VERY top of a php page. and then ist gziped :D

Anderman
10-03-2005, 07:45 PM
Really theres no point of a .css page as usualy its only about 10 lines big on an average site.

Homesrfan
14-03-2005, 10:30 PM
I think making a .css file makes a big difference.
Its easier to manage and you can just put one simple line on each page you want. :D

Mentor
15-03-2005, 05:17 PM
I think making a .css file makes a big difference.
Its easier to manage and you can just put one simple line on each page you want. :D
true it can be useful for the reusablity but it dont realy do much for loading times :/

Matty
15-03-2005, 06:19 PM
i'd rather wait couple of secs than do all this.

-JT-
20-03-2005, 12:57 AM
Personally .css files dont make my life any easier in the slightest. All i use is like 1 or two little snippets of css in my pages.

James:Ramsden
04-06-2005, 01:54 PM
yes, but if you have a lot of pages all with the same styles it can be easier just to attach the link to all of your pages. Then again you can just copy and paste from one page to another and some hosts dont support .css files. So I guess it's just a matter of opinion.

Mentor
04-06-2005, 01:57 PM
yes, but if you have a lot of pages all with the same styles it can be easier just to attach the link to all of your pages. Then again you can just copy and paste from one page to another and some hosts dont support .css files. So I guess it's just a matter of opinion.
I use a php include based navigtaion, so the index page contnts css plants on to every page of the site, so there would be little point.

Athogh i have sepirated a fe javascript files, athogh thats mainly for astitic values so i can sepirated and edit persific code more easly

ED::
03-07-2005, 08:40 PM
i dont get it?

Mentor
06-02-2006, 03:01 PM
In retro spect non of them actaly save you any time with page load. Gzipings realy where youd want to go to achive that, also saves on bandwidth "/

Echo-Host
27-09-2006, 11:26 AM
Hm... dont know if this is good enough to sticky yourself for.
But I'll give you something for your work...
Rep.. I guess. (But no rep from me)

I agree

Y!
12-10-2006, 04:21 PM
You guys don't know what you're talking about... In management of a website terms using this techinque allows you to update a site which could have 1000+ pages by editing one or maybe a couple of .css or .js files depending on the coding you are using on your site. I know that editing each page one at a time not only takes ages but also leaves room for human error. :) + rep for a great and simple guide!

entor M
12-10-2006, 10:13 PM
You guys don't know what you're talking about... In management of a website terms using this techinque allows you to update a site which could have 1000+ pages by editing one or maybe a couple of .css or .js files depending on the coding you are using on your site. I know that editing each page one at a time not only takes ages but also leaves room for human error. :) + rep for a great and simple guide!
But this isnt about easy of updateing? and most people here dont use a site comprised of a load of small html files? we use self contained user systems which can easly include css, a repated code in with ease, and are far easyer to update and maintain than a load of html pages, many even have online adminstration systems "/

Plus this is about increasieng page load, which few of the techniques here do, css and js files do to improved cacheing of them, can save minor amounts, while Gzipping the one not mentioned is more along the lines of a 70/80 % band width saveing per page load which is alot more "/

*
01-06-2007, 02:29 PM
<? ini_set('zlib.output_compression_level', 8); ob_start("ob_gzhandler"); ?>

Will work a charm.

Want to hide these adverts? Register an account for free!