perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Perrin Harkins <>
Subject Re: Storing config values in-memory between sessions
Date Thu, 29 Oct 2009 15:30:28 GMT
On Thu, Oct 29, 2009 at 12:13 AM, Mahesh Khambadkone
<> wrote:
> Confused slightly by the Apache phases and how it plays with older CGI
> scripts, what would be the best way to implement this in-memory cache
> that can be dirtied from time to time?

You can't keep things in memory with CGI scripts because they are
spawned and exit on each request.  You'll need to cache things in a
database or file.  The dirt-simple solution is a file that you write
periodically from a cron job, and read from your CGI scripts.  If you
read it frequently, it will be kept in the filesystem cache so the
read will be extremely fast.

- Perrin

View raw message