View Full Version : My template system is slow...

09-20-2003, 12:08 AM
$string = phpnetfile_get_contents("./templates/$template/template.php");

$patterns[] = "/{ACWB_LMENU}/"; ob_start(); if (file_exists("$lmenu")) { include("$lmenu"); } $contents[] = ob_get_contents(); ob_end_clean();

$patterns[] = "/{ACWB_RMENU}/"; ob_start(); if (file_exists("$rmenu")) { include("$rmenu"); } $contents[] = ob_get_contents(); ob_end_clean();

// Copyright
$patterns[] = "/{ACWB_COPYRIGHT}/"; $contents[] = "Website Backbone Version. 1.0.0 Copyright (C) 2003 <a href=\"http://www.acecoolco.com\" target=\"_blank\">Acecool Company</a>, Additional code + Fixes: <a href=\"mailto:Cozza2o@hotmail.com\">Rogue</a> - All rights reserved. <br>$copyright";

print preg_replace($patterns, $contents, $string);

Basically, people using a firewall, it loads like in minutes, people without it loads in a few seconds (normal)

Any ideas?

09-20-2003, 12:31 PM
That would just be a coincidence as a firewall can have absolutely no effect on how fast the PHP engine parses your pages and sends them to the browser. By the time anything has been sent your firewall it has already completed being parsed by PHP so only HTML is being sent at that point.

09-20-2003, 12:48 PM
If the problem is how long it takes people to view the pages then the slowness is more than likely to do with connections speeds (whether their modem speed or the speed/size of your host servers connection to main pipe).

You're probably looking at a few microseconds for the script to be parsed/processed and then a variable number of seconds for the file(s) to be sent to the client.

09-20-2003, 02:03 PM
Well some people at a site are saying it loads fast, then people with firewalls say it loads in 2 minutes, 3 mins, 4 mins, 5 mins...