2008年11月23日星期日

Re: [fw-db] prepared statements

On Sat, Nov 22, 2008 at 10:50 PM, Matheus Martins <mathrm@gmail.com> wrote:
> Hi,
> Regarding caching your query, have you ever thought about using Zend_Cache?
> More specifically Zend_Cache_Frontend_Function
> http://framework.zend.com/manual/en/zend.cache.frontends.html#zend.cache.frontends.function
>
> Zend_Cache_Frontend_Function caches the results of function calls. It has a
> single main method named call() which takes a function name and parameters
> for the call in an array.
>
> You can declare a function that returns your data.
> Then you cache this function and that's done!

Yes and no.

* People always mistake caches for a one-size-fits-all solution. They
are not as simple, when done right. For example, it's not done when
you cached the data, you (or maybe I) need to add in hooks to empty a
cache when new data is added by the customer, etc.. My customers don't
like to wait for five minutes before they see their "changes" live.

* I know that the query cache is not the best cache ever, it's also
not the solution to all problems. But to me building a cache in PHP to
replicate a feature my database has it built in is sort of pointless.
And all that because of a design error in the framework? ;-)

* In general, I see your argument and of course we already utilize
"caches" (direct apc calls, frontend caching (has nothing to do with
Zend_Cache_Frontend)) for different parts of the application.

Cheers,
Till

没有评论: