//flex table opened by JP

Click to See Complete Forum and Search --> : which would use more bandwidth/lag


arkanis
12-15-2001, 12:57 AM
which would be a bigger hog of bandwidth

using javascript functions to insert stuff into the page like for example if i have this

<script language="javascript">
function hello()
{
It is a Sunn
}
</script>
<body>
<script language="javascript"
hello;
</script>
y Day
</body>

it would print "It is a sunny Day"....
using it like this i could use the same bit of coding multiple times on the same page


or using the normal php server side includes to do the work



i dont' know much about how things affect servers or bandwidth or anything like that so i want to find out now before i change all my pages to the javascript method (which is ALOT easier to manage....


errrr what I wanna find out is, if the javascript method would use up more bandwidth or lag the server more than server side includes would

i havn't seen this done on any sites so there has to be some reason

steve2
12-17-2001, 09:11 PM
Hi

PHP (like ASP) is a server side script that means that the script is called & executed by the server before it is sent to the client browser. Java/s on the other hand is client based script ie. it is downloaded then interpreted by the browser and executed on the client machine.

As far as overheads go:

PHP would produce more processing overhead for your server and make it workharder, but as far as the client is concerened this is a good thing as it will seem to load faster because thier system doesnt do much of the work.

Java/s seems to load slower from the client point of view because it has to download, interperate then execute the code.

To cut a long story short, use Java/s to save overheads on your server but it will appear slower to the client.

To speed up the web site from the client point of view use PHP but this will put more load on your server, but not neccessarily cause a lot of "lag".

Lag or excessive use of bandwidth can be caused by lots of things, speed of server, ISP load, time of day, amount of graphics used, using access instead of SQL etc etc etc . .. . . . . .. . . . . .

What I would do is create a couple of pages one in PHP the other in J/s and time them. I suppose it depends what you want, if it's your server and you want to keep processing overhead to a minimum use a client side script. If it's a rented/free server what the hell, let the server take some of the strain.
GL
Steve2

arkanis
12-17-2001, 09:23 PM
ah that makes perfect sense
thanks