Continued from page 1
If some processing can be achieved using JavaScript, such as form validation, then use that. JavaScript is processed by a vistors computer, not by webserver, reducing your servers work load even more.
3. Reuse Everytime you reuse a graphic, instead of adding new ones on each page, visitors computer, after first viewing, loads from its cache.
This is also true of CSS. Saving your CSS as an external file, as opposed to emedding CSS markup in each web page, means that after server loads it first time, visitors computer will load it from then on everytime a new page is opened.
4. Reduce database queries Webservers also have to process instructions by your dynamic code to access your database. Obviously then, more you ask of your databases, more work server does. If you ensure that your database queries only ask for information that you will make use of, you can substantially reduce workloads. For example, SQL queries like "SELECT * FROM table_name" are worst kind to send, especially if a table is made up of 20 fields and you will only be processing 3 of them. A query like "SELECT field1, field2, field3 FROM table_name" would then make more sense. Using WHERE in a query to limit number of records returned also helps.
5. Other advantages Using above techniques will not only reduce your servers workload, but it also results in less webspace usage, less bandwidth usage and pages themselves will be quicker to load anyway due to reductions in file sizes, and files loaded by visitor's cache as opposed to from your server.
Gareth McCumskey is the Managing Director for Nexus Interactive , a South African based company designed to allow businesses to make use of one IT provider for all their needs.