Welcome, Guest. Please login or register.
Did you miss your activation email?
May. 22, 2012, 10:46:56 AM
55238 Posts in 12404 Topics by 73714 Members
Latest Member: Heathercoles
News:
 
The PRADO Community » Prado v3.x » Bug Reports » TCache (empty cache values) « previous next »
Pages: [1] Print
Author Topic: TCache (empty cache values)  (Read 2237 times)
FragMaster B
PRADO Supporter
Senior Member
*

Karma: 6
Offline Offline

Posts: 229



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
Carl
PRADO v3.x Developer
Platinum Member
*****

Karma: 19
Offline Offline

Posts: 531


View Profile WWW
« Reply #1 on: Oct. 13, 2008, 10:47:06 AM »

Fixed. Smiley I set it to delete the cache value if the string is empty and expire is set to never.
Logged

Pages: [1] Print 
« previous next »
Jump to: