Cache Blocks error "onload"
| Author |
Message |
Aforo


Joined: Dec 27, 2007 Posts: 146
|
Post subject: Cache Blocks error "onload" Posted: Sat Jan 03, 2009 2:25 pm |
|
I'm working in blocks with cache for hight traffic sites and I found a interesting problem:
When I load from cache data, never I had problem until today.
Today I have a error in one block. Error was beacuse a array was "malformed". Tha error was this:
Quote:
Parse error: parse error, unexpected '"' in D:\Archivos de programa\EasyPHP 2.0b1\www\Dragon9.1\cache\Block_Temp-13_tmp.php on line 14
Error for me is not important.
I tried to avoid the error with this sentence:
Code:
if(isset($block['bid'])) { $bid=$block['bid']; } //necesary for compatibility 9.1 and 9.2 versions
$tmp = @Cache::array_load('tmp', 'Block_Temp-'.$bid, false); // Load data from "cache" directory
"@Cache::array_load" don't pass the malformed array. All the load of blocks was stoped. "@" avoit send errors, but not continues with block execution.
For me the important is not de bad data... (it was a accident)
I need than a simple data with a mistake, don't stop all the portal.
Any Idea, please?
_________________ Aforo - Google Earth - WebNaranja - DFcms.es
Aforo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Centos 5/Apache 2.2.3/MySQL:5.0.45/PHP:5.2.10 /9.2 |
|
| Back to top |
|
 |
Aforo


Joined: Dec 27, 2007 Posts: 146
|
Post subject: Re: Cache Blocks error "onload" Posted: Tue Jan 20, 2009 7:03 pm |
|
Nobody knows???
I think that it's not possible avoid this fatal error.
But I found a nice solution for this case that minimizes pain...
I wanted to use cache for my blocks and I have been succesfull in many blocks (not in "personalized" blocks, but I get some improvings also)
Now I have used cache in many of my block in:
www.google-earth.es/
Time of ejecution has drop a lot of (specially against robots) and database is now consulted only when is necessary.
I'll put you some examples of blocks with cache in the next days.
_________________ Aforo - Google Earth - WebNaranja - DFcms.es
Aforo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Centos 5/Apache 2.2.3/MySQL:5.0.45/PHP:5.2.10 /9.2 |
|
| Back to top |
|
 |
Eestlane


Joined: Apr 06, 2005 Posts: 1406 Location: Estonia
|
Post subject: Re: Cache Blocks error "onload" Posted: Tue Jan 20, 2009 7:26 pm |
|
Why was it necessary for you to allow malformed arrays?
Eestlane's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Linux/2.0.63/5.0.67/5.2.8/9.2.1 |
|
| Back to top |
|
 |
Aforo


Joined: Dec 27, 2007 Posts: 146
|
Post subject: Re: Cache Blocks error "onload" Posted: Tue Jan 20, 2009 7:37 pm |
|
In a block with cache you write each period in cache. Ussually you haven't any problem.
But one day in Google Earth, one of the cache block failed writing an array (it was perhaps an accident because never happend again).
When a block fails with a fatal error, the program doesn't continue (stop) and you have only the html code that you have got before... this mind that if a left block fails, you don't get central content of your website or right blocks...
I found a way for minimize this posibility: testing cache file before using (loading) the array.
_________________ Aforo - Google Earth - WebNaranja - DFcms.es
Aforo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Centos 5/Apache 2.2.3/MySQL:5.0.45/PHP:5.2.10 /9.2
Last edited by Aforo on Tue Jan 20, 2009 7:44 pm; edited 1 time in total |
|
| Back to top |
|
 |
Eestlane


Joined: Apr 06, 2005 Posts: 1406 Location: Estonia
|
Post subject: Re: Cache Blocks error "onload" Posted: Tue Jan 20, 2009 7:41 pm |
|
I think I understand, thanks for sharing.
Eestlane's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Linux/2.0.63/5.0.67/5.2.8/9.2.1 |
|
| Back to top |
|
 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
|

|
User Info ![Show/hide content [x]](themes/dragonfly/images/minus.png)
 Welcome Anonymous
Last CVS commits ![Show/hide content [x]](themes/dragonfly/images/minus.png)
Languages ![Show/hide content [x]](themes/dragonfly/images/minus.png)
Community ![Show/hide content [x]](themes/dragonfly/images/minus.png)
 Support for DragonflyCMS in a other languages:
• Deutsch
• Español
X-links ![Show/hide content [x]](themes/dragonfly/images/minus.png)
Preview theme ![Show/hide content [x]](themes/dragonfly/images/minus.png)
Each user can view the site with a different theme.
Themes marked with a * also change the forum look.
|