On Wed, 2004-08-25 at 14:52, Paul Higgins wrote:
> Hello all,
> 
> I have some questions regarding caching information with PHP.  I was 
> thinking that I might cache all information that won't be changing for long 
> periods of time...possibly only once a day or so, instead of querying the 
> database for information every time.  My question is:  is there such as 
> thing as too much caching?
> 
> Can I cache too much and therefore negate the advantages of caching?

As long as the overhead in caching remains less than the overhead in not
caching, I would say maybe.  :)

A single database query returns an array.  You use the array to build a
page.  You cache the page.  The cached version of the page gets hit 100
times.  Is the overhead in pulling the file from your cache 100 times
less than re-doing the query 100 times?  That depends.  Some databases
have query caching, and so do most file systems.  There are also PHP
caching tools like TurkeMM Cache and Zend that cache byte code only.

I'd bench it both ways and then decide based on the queries, the
development environment, and the cache timeout limitations/requirements.


-- 
Greg Donald

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to