perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carl Eklof <>
Subject Re: Using EmbPerl's Caching Functionality
Date Wed, 21 Dec 2005 22:16:21 GMT
 I applied the patch, and caching now works (thanks Gerald!). I tested the following lines
in my httpd:
 Which seems to have solved my problem of the cache not making the distinction between:
 I don't see a way to explicity tell EmbPerl to 'not cache' certain pages. I ended up making
the cache_key_func call another sub that performed additional logic to set the key to "",
and I used a EMBPERL_EXPIRES_FUNC to always expiring those queries. 
 The benchmark results so far show a very significant improvement (>2x) when replaying
the user logs for a duration of time about as long as the expiration time. I have a lot of
queries to the home-page for each city, so caching those alone is significant. Incase anybody
is currious to see another EmbPerl site, mine is at ( I should have
caching on the live site in the next couple days.
 The only awkwardness I'm now seeing is that Embperl seems to sometimes call the cache_key_function
multiple times per request. I added a 'print STDERR 'FOO' to the sub, and I occationally see
the message get printed multiple times (~11).
 I highly recommend applying the patch, and giving caching a whirl. It's a nice performance
gift from Gerald, and easier to set up than most dedicated caching systems.
 Happy Holidays,

----- Original Message ----
From: Gerald Richter <>
To: Carl Eklof <>;
Sent: Wednesday, December 21, 2005 00:13:30
Subject: RE: Using EmbPerl's Caching Functionality


> 1) I couldn't get EMBPERL_CACHE_KEY_FUNC, or 
> EMBPERL_EXPIRES_FUNC to work in my httpd.conf (and I do have 
> Embperl_UseEnv on) Trying to set either one would cause 
> Apache to seg fault. 
>  Does anybody have any working sample of the EMBPERL_CACHE_KEY_FUNC?

The attached patch should fix both the xx_FUNC parameters in httpd.conf.

Note that EMBPERL_CACHE_KEY_FUNC can only be defined in httpd.conf, but not
inside the page itself (as EMBPERL_EXPIRES_FUNC does)


** Virus checked by BB-5000 Mailfilter ** 

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message