sonictrip.net Posted March 30, 2007 Posted March 30, 2007 Hi all, I have made a few different osC sites and ive never come across this speed issue when loading the site. If you compare 2 of the sites i've done, www.bwear.ie is on a windows server and uses a modified templatemonster template, but it loads really fast compared to www.acousticdimension.ie which is on a Linux server and also uses a templatemonster template. The speed issue on acousticdimension.ie seems to be slower since we moved the site over to SSL. Im thinking it could be the way the page is being cached coz even when you browse a few different pages, it seems like its loading all the images for the first time instead of using the cached files from your internet cache?? Is there a specific bit of code that tells the browser not to reload everything from scratch on every page request. Can someone please visit the above two sites and let me know how much slower acousticdimension.ie is taking to load compared to bwear.ie? Thanks a mill! Quote
Bushmaster Posted March 30, 2007 Posted March 30, 2007 You have some coding problems on www.acousticdimension.ie . Don't know what it is. You no right click script does not work on that site. And it has more links to build do it will take longer. The amount of catagories alone will add to the load time. Seach forums for optimizing I don't know how much of it can be done on your template but you might be able to save some time if it ia counting all the catagories each load Quote
sonictrip.net Posted April 9, 2007 Author Posted April 9, 2007 You have some coding problems on www.acousticdimension.ie . Don't know what it is. You no right click script does not work on that site. And it has more links to build do it will take longer. The amount of catagories alone will add to the load time. Seach forums for optimizing I don't know how much of it can be done on your template but you might be able to save some time if it ia counting all the catagories each load I disabled the right click code for the moment until i figure out these problems. It's weird, they have the category code inside the column_left.php file instead of using the code in boxes/categories.php The following code is my whole column_left.php with the categories code that they use, can anyone spot anything wrong in this code or anything that might slow it down? There are a few things that stick out like : define(TABLE_CATEGORIES, "categories"); define(TABLE_CATEGORIES_DESCRIPTION, "categories_description"); The code above doesnt seem to exist in boxes/categories.php yet it is in the code below...? <?php /* $Id: column_left.php,v 1.15 2003/07/01 14:34:54 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ ?> <table border="0" cellspacing="1" cellpadding="0" width="197" class="zxc6"> <tr><td style="background-image:url(images/m20.gif);" width="197" height="31"> <span class="tx2"><?=HEADER_TITLE_CATALOG?></span></td></tr> <tr><td height="7"></td></tr> <tr><td width="197"><ul> <? function tep_show_category($counter) { global $tree, $categories_string, $cPath_array, $ii; $ii++; if(!$tree[$counter]['level']){ $categories_string .= $categories_string ? '' : ''; $categories_string .= '<li class="bullet"><a href='; if ($tree[$counter]['parent'] == 0) { $cPath_new = 'cPath=' . $counter; } else { $cPath_new = 'cPath=' . $tree[$counter]['path']; } $categories_string .= tep_href_link('index.php', $cPath_new) . '>'; // display categry name $categories_string .= $tree[$counter]['name']; $categories_string .= '</a></li>'; }else{ // SUBCATEGORY $categories_string .= ''; for($i=0;$i<$tree[$counter]['level'];$i++) $categories_string .= ''; $categories_string .= '<li class="bullet"><a href='; if ($tree[$counter]['parent'] == 0) { $cPath_new = 'cPath=' . $counter; } else { $cPath_new = 'cPath=' . $tree[$counter]['path']; } $categories_string .= tep_href_link('index.php', $cPath_new) . '> :: '; // display category name $categories_string .= $tree[$counter]['name']; $categories_string .= '</a></li>'; } if ($tree[$counter]['next_id'] != false && $ii < 40) { tep_show_category($tree[$counter]['next_id']); } } define(TABLE_CATEGORIES, "categories"); define(TABLE_CATEGORIES_DESCRIPTION, "categories_description"); $categories_string = ''; $tree = array(); $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name"); while ($categories = tep_db_fetch_array($categories_query)) { $tree[$categories['categories_id']] = array('name' => $categories['categories_name'], 'parent' => $categories['parent_id'], 'level' => 0, 'path' => $categories['categories_id'], 'next_id' => false); if (isset($parent_id)) { $tree[$parent_id]['next_id'] = $categories['categories_id']; } $parent_id = $categories['categories_id']; if (!isset($first_element)) { $first_element = $categories['categories_id']; } } //------------------------ if ($cPath) { $new_path = ''; reset($cPath_array); while (list($key, $value) = each($cPath_array)) { unset($parent_id); unset($first_id); $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$value . "' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name"); if (tep_db_num_rows($categories_query)) { $new_path .= $value; while ($row = tep_db_fetch_array($categories_query)) { $tree[$row['categories_id']] = array('name' => $row['categories_name'], 'parent' => $row['parent_id'], 'level' => $key+1, 'path' => $new_path . '_' . $row['categories_id'], 'next_id' => false); if (isset($parent_id)) { $tree[$parent_id]['next_id'] = $row['categories_id']; } $parent_id = $row['categories_id']; if (!isset($first_id)) { $first_id = $row['categories_id']; } $last_id = $row['categories_id']; } $tree[$last_id]['next_id'] = $tree[$value]['next_id']; $tree[$value]['next_id'] = $first_id; $new_path .= '_'; } else { break; } } } $categories_string .= ''; tep_show_category($first_element); $categories_string .= ''; echo $categories_string; ?> </ul></td></tr> <? include(DIR_WS_BOXES . 'specials.php');?> <? include(DIR_WS_BOXES . 'whats_new.php');?> <? include(DIR_WS_BOXES . 'information.php');?> </table> Quote
sonictrip.net Posted April 9, 2007 Author Posted April 9, 2007 Right, i've narrowed it down, it seems that when i have my HTTPS_SERVER set to https:// in includes/configure.php it goes real slow but when it is set to normal http:// it flies along! Loads really fast... What could be wrong with the SSL setup on the server that would cause such a slow down loading pages, it seems like a cache issue, so could this be related to the SSL issue? Thanks for any help... Quote
♥Vger Posted April 9, 2007 Posted April 9, 2007 As for the Category code in the left column - that's the c**p way Template Monster script kiddies code things. https pages will always be slower than http pages because of the encryption of the pages in transit, but even more so if you use a shared ssl. Comparing the two sites is like comparing chalk and cheese. The slower site has a much bigger Flash header and many more product images on the homepage - all of which slow the site down. I also doubt that the Flash has been optimised to load quickly - or perhaps it has on the first site but not on the second site. Vger Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.