Re: How should I cache database data for php?
| From: | Garth Dahlstrom | Date: | Tue, 22 Jan 2002 02:04:19 +0000 |
| Subject: | Re: How should I cache database data for php? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-81471@lists.php.net to get a copy of this message | ||
my two cents...
I used to work at a newspaper we used a very elaborate
caching system, it used to function at the at the
page subcomponent level (i.e. header, footer, left nav, articles
were all stored separately) AND page level. The page
subcomponents were cached together as pages. This was a good
system because it allowed for the subcomponents to be updated
without effecting the pages (by deleting the subcomponent cache
and leaving the page cache), then subcomponents were regenerated
with new contents, and finally the page caches were deleted
and the pages were then regenerated from the cached subcomponents
(which was the same speed as doing SSI's basically). Anyway,
a fast system, a bit complex, a bit ridged (if you want
dynamic stuff in your pages) but solid for a newspaper.
Now on to DB caching... ADODB has support for Database caching,
it basically dumps the database to a file and reloads it
transparently when you next do the same select on the DB.
This would work if you coupled it with a publish event... i.e.
DB changes -> have a script SSH to the web servers and delete
the cache / or pregenerate the cache on the db server and upload
it to the webserver as a temp file and then do a mv to the real
cache file... many ways to skin that cat.
-Garth
Northern.CA ===--
http://www.northern.ca
Canada's Search Engine