cachesimple: doesn't cache?

Creating and modifying plugins.
Post Reply
Boris

cachesimple: doesn't cache?

Post by Boris »

I switched to a new server and now the cache-plugin isn't working any more. (don't know for shure if it worked up to now, but it worked some time :))

To be precise: The plugin works, but does not create any file/directory below template_c, athought it is writeable to the webserver (i even tested mkdir with a small script).

Here is what the debug-modus gives me:

Code: Select all

[29.01.2007 19:20] /
[29.01.2007 19:20] serendipity_cachesimple__4211587985 cache prepared
[29.01.2007 19:20] CACHE MISS

[29.01.2007 19:20] /
[29.01.2007 19:20] serendipity_cachesimple__4211587985 cache prepared
[29.01.2007 19:20] CACHE MISS
[29.01.2007 19:20] Shutdown function: Got Attention.
[29.01.2007 19:20] CACHE STORED (25206 bytes)
[29.01.2007 19:20] CACHE STORED (25206 bytes)
[29.01.2007 19:20] CACHE STORED (25206 bytes)

Code: Select all

[29.01.2007 19:25] /artikel/2005/04/07/C3.html
[29.01.2007 19:25] serendipity_cachesimple__artikel_2005_04_07__3_html4211587985 cache prepared
[29.01.2007 19:25] CACHE MISS

[29.01.2007 19:25] /artikel/2005/04/07/C3.html
[29.01.2007 19:25] serendipity_cachesimple__artikel_2005_04_07__3_html4211587985 cache prepared
[29.01.2007 19:25] CACHE MISS
[29.01.2007 19:25] Shutdown function: Got Attention.
[29.01.2007 19:25] CACHE STORED (8001 bytes)
[29.01.2007 19:25] CACHE STORED (8001 bytes)
[29.01.2007 19:25] CACHE STORED (8001 bytes)
It's weird, that it seems to call save() three times and does the init two times, isn't it?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: cachesimple: doesn't cache?

Post by garvinhicking »

Hi!

Indeed the debug log does not look very sane. What other event plugins are you running? Might be that one is responsible for spawning the plugin multiple times.

As for the creation of the directory, this surely sounds wiked. Could it be that somewhere in the database you still have references to an older direcotry structure? Maybe you could grep a SQL dump to check that?

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Boris

Re: cachesimple: doesn't cache?

Post by Boris »

garvinhicking wrote:Indeed the debug log does not look very sane. What other event plugins are you running? Might be that one is responsible for spawning the plugin multiple times.
* serendipity_event_nl2br
* serendipity_event_popfetcher
* serendipity_event_spamblock
* serendipity_event_cachesimple
* serendipity_event_staticpage
* serendipity_event_entryproperties
* serendipity_event_statistics
* serendipity_event_google_sitemap
* serendipity_event_trackback
* serendipity_event_weblogping

And 3 selfwritten specific to my blog, but they're not doing anthing freaky (one markup, random picture and "AJAX"-search without the AX ;-))
As for the creation of the directory, this surely sounds wiked. Could it be that somewhere in the database you still have references to an older direcotry structure? Maybe you could grep a SQL dump to check that?
There were some references to the old dir in pluginlist, I cleaned that table and now it's all the new path but the problem stays.
I did an additional debug-output and the directory is correct.

I even did a clean installation at another directory and had the same problem.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: cachesimple: doesn't cache?

Post by garvinhicking »

Hi!

Are you maybe using an old local version of the PEAR Cache_Lite module? S9y uses existing PEAR on your server, so maybe that interfers?

The list of your plugins sounds okay, you are right on that.

If that doesn't lead us to any clue I'll try to create a extra-verbose debugging version of that plugin later the week.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Boris

Re: cachesimple: doesn't cache?

Post by Boris »

garvinhicking wrote:Are you maybe using an old local version of the PEAR Cache_Lite module? S9y uses existing PEAR on your server, so maybe that interfers?
I thought about that too but didn't find it. Now I found it, it's cvs-version is "v 1.37 2005/11/24"
I set $serendipity['use_PEAR'] = FALSE; but that does not improve the situation.

EDIT: I just saw that the bundled version is even a few versions older.
garvinhicking wrote:If that doesn't lead us to any clue I'll try to create a extra-verbose debugging version of that plugin later the week.
I just found out due to php-warning, that he gets an access denied on mkdir. I'll have a look at this myself, because it is writeable.

EDIT: After creating 2 dirs manually it worked for the mainpage.
Boris

Post by Boris »

Got it:

In my test I created a dir with

Code: Select all

mkdir('./templates_c/cache_1');
which worked.

But Cache_Lite tries

Code: Select all

mkdir('./templates_c/cache_1/');
which fails (note the trailing '/').

http://forum.hardened-php.net/viewtopic.php?id=152
It seems to be a problem with Suhosin and safe-mode.


I finally created the directories myself, it's the easiest solution.

Code: Select all

for j in $(seq 0 9) a b c d e f; do mkdir cache_$j; cd cache_$j; for i in $(seq 0 9) a b c d e f; do mkdir cache_$j$i; done; cd ..; done
Post Reply