Edmonds Commerce Logo
  • home
    • blog
  • ecommerce
    • product catalogue
    • order processing
    • customer services
    • stock control
    • human resources
    • management information
  • development
    • oscommerce
    • php
    • mysql
    • open source
    • performance tuning
  • design
  • marketing
  • contact us
    • pricing

Edmonds Commerce Blog

Freelance PHP Ecommerce and SEO Developer in the UK

Latest Posts

CRELoaded Remove Google Ads -
ICECat Integration with osCommerce, Magento etc
Magento UK
PHP Cached Download Function

Most Popular Posts

PHP Email Attachment Function Freelance osCommerce UK Ultimate osCommerce Checkout - Fast and Friendly PHP : Dead Easy Excel Export

Speeding Up osCommerce

February 6th, 2008
Read More oscommerce

osCommerce is a great ecommerce package which is hugely popular due to its full feature set, massive options for customisation and a huge support base. However if you want to run a large catalogue, or have plenty of visitors then speed can become an issue. There are a number of things you should look at to increase the overall speed of your osCommerce store

The problem is in the way that osCommerce has evolved, and also in the way that they have tried to make the code base as portable as possible. This means that as standard, the software may be doing quite a few processes that are not really necessary for your store.

One of the biggest culprits of page load time problems, especially on sites with large catalogues is the split_page_results class. In standard trim, the class performs the most complex query of your catalogue page twice - once to find the number of rows and a second time to actually grab the results. On a small site you may not notice this, but on a larger site this query can represent a large portion of the total page load time.

The answer is to modify the class so that it uses the SQL_CALC_FOUND_ROWS functionality to simultaneously perform the query and calculate the total number of rows. Then to get this number of rows, you only have to select FOUND_ROWS() instead of performing the whole query again.

PLAIN TEXT
PHP:
  1. $count_query = str_replace('select', 'select SQL_CALC_FOUND_ROWS ', $this->sql_query);
  2. if(!isset($this->current_page_number)){
  3. $this->current_page_number = 1;
  4. }
  5. $current_limit = " limit " . ((($this->current_page_number -1) * $this->number_of_rows_per_page)) .', ' . $this->number_of_rows_per_page;
  6. $this->sql_query = $count_query . $current_limit;
  7. $this->sql_query = tep_db_query($this->sql_query);
  8. $count = tep_db_query("select FOUND_ROWS()");
  9. $this->number_of_rows = mysql_result($count, 0);

Bookmark this Post
Add 'Speeding Up osCommerce' to Del.icio.usAdd 'Speeding Up osCommerce' to diggAdd 'Speeding Up osCommerce' to FURLAdd 'Speeding Up osCommerce' to blinklistAdd 'Speeding Up osCommerce' to redditAdd 'Speeding Up osCommerce' to Feed Me LinksAdd 'Speeding Up osCommerce' to TechnoratiAdd 'Speeding Up osCommerce' to Yahoo My WebAdd 'Speeding Up osCommerce' to NewsvineAdd 'Speeding Up osCommerce' to SocializerAdd 'Speeding Up osCommerce' to Ma.gnoliaAdd 'Speeding Up osCommerce' to Stumble UponAdd 'Speeding Up osCommerce' to Google BookmarksAdd 'Speeding Up osCommerce' to RawSugarAdd 'Speeding Up osCommerce' to SquidooAdd 'Speeding Up osCommerce' to SpurlAdd 'Speeding Up osCommerce' to BlinkBitsAdd 'Speeding Up osCommerce' to NetvouzAdd 'Speeding Up osCommerce' to RojoAdd 'Speeding Up osCommerce' to BlogmarksAdd 'Speeding Up osCommerce' to ShadowsAdd 'Speeding Up osCommerce' to Co.mments
Add 'Speeding Up osCommerce' to ScuttleAdd 'Speeding Up osCommerce' to BloglinesAdd 'Speeding Up osCommerce' to TailrankAdd 'Speeding Up osCommerce' to SegnaloAdd 'Speeding Up osCommerce' to OKnotizieAdd 'Speeding Up osCommerce' to NetscapeAdd 'Speeding Up osCommerce' to Bookmark.itAdd 'Speeding Up osCommerce' to AskAdd 'Speeding Up osCommerce' to SmarkingAdd 'Speeding Up osCommerce' to LinkagogoAdd 'Speeding Up osCommerce' to DeliriousAdd 'Speeding Up osCommerce' to SocialdustAdd 'Speeding Up osCommerce' to Live-MSNAdd 'Speeding Up osCommerce' to SlashDotAdd 'Speeding Up osCommerce' to SphinnAdd 'Speeding Up osCommerce' to DiggitaAdd 'Speeding Up osCommerce' to SeotribuAdd 'Speeding Up osCommerce' to FaceBookAdd 'Speeding Up osCommerce' to UpnewsAdd 'Speeding Up osCommerce' to WikioAdd 'Speeding Up osCommerce' to Social Bookmarking Reloaded

Feed | Respond | Trackback

Leave a Reply

  • RSS Feed
  • Categories

    • apache
    • barcode
    • creloaded
    • curl
    • customer services
    • debugging
    • ecommerce
    • email
    • excel
    • firefox
    • flash
    • gd
    • graphs
    • hosting
    • icecat
    • internet news
    • javascript
    • link building
    • linux
    • magento
    • management
    • mod_rewrite
    • mysql
    • oscommerce
    • php
    • plesk
    • product catalogue
    • product feed
    • programming
    • regular expressions
    • scraping
    • search engine optimisation
    • spidering
    • ubuntu
    • web design
    • web development
    • Windows
    • xampp
    • zip
  • Archives

    • August 2008
    • July 2008
    • June 2008
    • May 2008
    • April 2008
    • March 2008
    • February 2008
  • Tags

    addons advanced adverts blackhat blocking css curl development directories find firefox google hosts file html javascript keywords links msn mysql myths operators oscommerce paid links paid placement performance php ppc reciprocal linking replace screen scraping security seo serp speed spider spidering tuning user friendly vista web web design web developer
  • Random Posts

    • ICECat Integration with osCommerce, Magento etc
    • PHP: Recursive Create Path (if not exists)
    • File Comparison on Ubuntu
    • Get Name from Email Address
    • SEO, Links, Pagrank and Anchor Text
    • Speeding Up osCommerce
    • EAN13 Barcode Check Digit with PHP
    • Running Internet Explorer under Ubuntu Linux
    • Advanced PHP Debug Function
    • Saving a File or Webpage using PHP

Edmonds Commerce related questions? Send us a message or call us on 0844 357 0201.

Freelance PHP Web Design UK Commercial Web Design