Cache Blocks error "onload"
Post new topic   Reply to topic   Printer Friendly Page     Forum IndexExplain Please
Author Message
Aforo
I18N / L10N Lead Dev


Joined: Dec 27, 2007
Posts: 146

PostPost subject: Cache Blocks error "onload"
Posted: Sat Jan 03, 2009 2:25 pm
Reply with quote

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
View user's profile Visit poster's website
Aforo
I18N / L10N Lead Dev


Joined: Dec 27, 2007
Posts: 146

PostPost subject: Re: Cache Blocks error "onload"
Posted: Tue Jan 20, 2009 7:03 pm
Reply with quote

Nobody knows??? Laughing

I think that it's not possible avoid this fatal error.

But I found a nice solution for this case that minimizes pain... Confused

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. Very Happy

_________________
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
View user's profile Visit poster's website
Eestlane
I18N / L10N Lead Dev


Joined: Apr 06, 2005
Posts: 1406
Location: Estonia

PostPost subject: Re: Cache Blocks error "onload"
Posted: Tue Jan 20, 2009 7:26 pm
Reply with quote

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
View user's profile Send e-mail Visit poster's website
Aforo
I18N / L10N Lead Dev


Joined: Dec 27, 2007
Posts: 146

PostPost subject: Re: Cache Blocks error "onload"
Posted: Tue Jan 20, 2009 7:37 pm
Reply with quote

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
View user's profile Visit poster's website
Eestlane
I18N / L10N Lead Dev


Joined: Apr 06, 2005
Posts: 1406
Location: Estonia

PostPost subject: Re: Cache Blocks error "onload"
Posted: Tue Jan 20, 2009 7:41 pm
Reply with quote

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
View user's profile Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   Printer Friendly Page     Forum IndexExplain Please All times are GMT
Page 1 of 1


Jump to:  
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

Dedicated Server & Bandwidth Sponsored by DedicatedNOW
User Info [x]

Welcome Anonymous

Nickname
Password
(Register)

Last CVS commits [x]

Languages [x]

Community [x]

Support for DragonflyCMS in a other languages:

Deutsch
Español

X-links [x]
UltraEdit Browse Happy logo Firefox MySQL PostgreSQL Valid CSS! Valid XHTML 1.0! Unicode Encoded Badge NukeBiz Resources Raven DragonflyCMS Dedicated Now InsideSupport Lampe Berger

Preview theme [x]
Each user can view the site with a different theme.
Themes marked with a * also change the forum look.


You are seeing squares or questionmarks on this page?

All content of this website is copyrighted by the Creative Commons NC-SA
The logos and trademarks used on this site are the property of their respective owners
We are not responsible for comments posted by our users, as they are the property of the poster.
Our server runs on a P3 1.2GHz with 512MB RAM with no accelerators
Support GoPHP5.org
This page generated in 0.3716 seconds with 16 DB Queries in 0.0314 seconds
Memory Usage: 2.89 MB
Interactive software released under GNU GPL, Code Credits, Privacy Policy