Welcome, Guest. Please login or register.
Did you miss your activation email?
Oct. 11, 2008, 03:29:12 PM
47672 Posts in 10455 Topics by 5339 Members
Latest Member: phamlehoaian
News: PRADO community toolbar eases your interaction with the PRADO community.
 
The PRADO Community » Prado v3.x » Bug Reports » TCache (empty cache values) « previous next »
Pages: [1] Print
Author Topic: TCache (empty cache values)  (Read 426 times)
FragMaster B
PRADO Supporter
Senior Member
*

Karma: 5
Offline Offline

Posts: 205



View Profile WWW
« on: May. 04, 2008, 05:07:41 PM »

I think the following line should be added to the top of both "TCache->add" and "TCache->set":

Code:
if (empty($value)) return false;

Reason:
I noticed that my PradoCache table had thousands of entries that were all 23B. Further inspection revealed that all of these values held nothing but an empty string. Worse yet they were also marked as never expire. I fixed this in my extension of TCache via the following, but it should probably be added directly to TCache so as not to trip up other users.

Code:
public function set($id, $value, $expire=0, $dependency=null){
if (empty($value)) return false;
else return parent::set($id, $value, $expire, $dependency);
}

public function add($id, $value, $expire=0, $dependency=null){
if (empty($value)) return false;
else return parent::add($id, $value, $expire, $dependency);
}

Edit: Ticket created here: http://trac.pradosoft.com/prado/ticket/848
« Last Edit: May. 05, 2008, 04:31:26 PM by FragMaster B » Logged
Pages: [1] Print 
« previous next »
Jump to: