Teen Programmers Unite  


Return to forum top

stumped in my web...

Posted by bauey [send private reply] at March 14, 2002, 01:59:31 AM

i'm looking for ways on how to make my web pages smaller in file size. i'm trying to optimize my code and i'm lost on how to do this. my web pages all use the same template so it's just a matter of using parts of the code all over again like a procedure. what i want to do is program my codes in a way that will imitate cascading style sheets. there is a file where all my style sheets are located then the code where they will all be called. i'm not sure if i can put my code in those style sheets... if it doesn't work i'm trying to look at cgi/perl for a solution... i need some advice on what language or procedure to use that will significantly reduce the file size of my codes. need help!!!

Posted by buzgub [send private reply] at March 14, 2002, 02:10:47 AM

I think you need to clarify if you want to save bandwidth or disk space on the server in order to get a sensible answer; even if you were to clarify this, it's quite off-topic.

Posted by metamorphic [send private reply] at March 14, 2002, 03:21:25 AM

a great and simplete way of doing what you said would be to use the PHP command include(). That way you could have files for the header and footer of your page, or whatever parts appear often. Then when you want a part, just include it. Once the file has been included once (i think it would) your browser would chache it and the user would no longer have to download that certain part. Saving bandwith and server space. Makes the pages load faster too

Posted by Psion [send private reply] at March 14, 2002, 07:54:25 AM

If you want to save disk space with static pages, then the ideal solution is SSI, server-side includes, if you have them available. You can put #include directives inside HTML comments and have the requested files inserted in their places by the web server. You can also automatically insert all sorts of freaky things like the data, without requiring any client-side scripting.

If this sounds interesting, you should look into how your host supports SSI. Many require that SSI-parsed files end in .shtml instead of .html.

Posted by RedX [send private reply] at March 14, 2002, 01:50:13 PM

An other way is looking over your page and remove some of the useless (or less important) things (E.g. special flashy buttons, images, sounds, etc...).
This can be a very painful procedure, but if you're strong, I'm sure you can live with less eyecandy. :-)
Go and seek those items unworthy of their serverspace!


You must be logged in to post messages and see which you have already read.

Log on
Save for later automatic logon

Register as a new user
Copyright TPU 2002. See the Credits and About TPU for more information.