NYCPHP Meetup

NYPHP.org

[nycphp-talk] Local File versus DB-based configuration settingstrategy

Mitch Pirtle mitch.pirtle at gmail.com
Wed Jul 19 09:49:16 EDT 2006


On 7/10/06, P Yurt <pyurt at yahoo.com> wrote:
> When you ask: So you're not caching your output?  ;-)
> Are you referring to caching the entire site so that is displays
> without
> hitting the PHP engine or DB server?
>
> If so, what is the price paid for "caching"

Depending on your setup, and your application requirements, you have
many opportunities for caching:

1) At the database level. MySQL provides a query cache that easily
provides this capability. Basically your configuration information in
the database would be stored in a cached query result, and since your
configuration would rarely change I would say this is a very good
scenario for the query cache to provide benefit.

2) At the code/execution level. You could install PHP accelerators and
bytecode compilers that cache all of your PHP scripts, so they are no
longer parsed for every single access by the client.

3) At the code/output level. You could use a caching library to cache
output of your PHP scripts, for example say one script generated a
login form, you could use Cache_Lite from PEAR so that your form
wouldn't need to be constantly generated (and regenerated).

4) At the transport level. You could proxy your application output, so
that your entire website resided in memory on a proxy server that was
in front of your application server. This would mean someone could
browse an entire site without requiring a single PHP script to be
executed.

I'm presenting next week at NYPHP, do come by and we can make sure
caching techniques are discussed. I've certainly learned a lot, and
would like to know what everyone else's experiences were.

-- Mitch



More information about the talk mailing list