osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 
 

A better tep_reset_cache_block

This is a discussion on A better tep_reset_cache_block within the New osCommerce Contributions forums, part of the osCommerce 2.2 Forums category; So my friend runs a biz with osC , and he was having major troubles with adding/modifying products. The sql ...


Go Back   osCommerce and osCMax shopping cart software forums > osCommerce 2.2 Forums > New osCommerce Contributions

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Reply

 

LinkBack (1) Thread Tools
  1 links from elsewhere to this Post. Click to view. #1  
Old 04-29-2007, 02:25 AM
michael_s's Avatar
osCMax Developer

 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 11,093
Thanks: 81
Thanked 348 Times in 327 Posts
Rep Power: 10
michael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond repute
Post A better tep_reset_cache_block

So my friend runs a biz with osC, and he was having major troubles with adding/modifying products. The sql updated, but the browser timed out before finishing the post. Upon investigation we isolated it down to the tep_reset_cache_block() function trying to clear cache files from the cache dir. The cache dir, /tmp/, was filled up with 40,000+ files, so the way tep_reset_cache_block() was iterating through the dir was far too slow and stupid. I have fixed this. He also didn't like that the entire also_purchased cache was removed and not just the cache files pertaining to the product being altered. I fixed this as well.

This new version of tep_reset_cache_block(), uses glob instead of readdir. It's much much faster and also it makes sure there is a properly set pid for the also_purchased cache. This is something of a hack/kludge. I am not familiar enough with the osC codebase to fix the root problem -- merely correct the symptom in the least obtrusive way I could.

This mod should be useful to anyone running a large osC installation and gets a lot of hits and a lot of sessions cached to disk. AFAIK, there are no downsides to this script, but I'm not guaranteeing odd behavior. It certainly shouldn't hose your site.

More...
__________________
Michael Sasek
osCMax Developer


  • osCMax Templates - Hundreds of premium quality templates designed for osCMax 2. Loyalty discounts up to 30% off!
    Each purchase supports the osCMax project with much needed funds!

  • xShop for osCMax - Windows Based osCMax administration. Improved workflow, security, speed and convenience.

  • osCMax Hosting - From basic hosting to High Availability, Load Balanced arrays, the most experienced osCMax host. Default multi server configuration for exceptional performance!

  • osCMax Template Tutorial - Learn how to make your own custom templates and how to use the powerful features of the osCMax template system.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Advertisement
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

LinkBacks (?)
LinkBack to this Thread: http://www.oscmax.com/forums/new-oscommerce-contributions/8779-better-tep_reset_cache_block.html

Posted By For Type Date
oscommerce : Blogs, Photos, Videos and more on Technorati This thread Refback 04-30-2007 07:51 AM


All times are GMT -8. The time now is 12:46 AM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
http://www.oscmax.com/forums/
Copyright 2008 osCMax