Cache action, query and view/element. So how do you know which to use, when?

Basic example we use Post action => view,  id => 123

We cache the query data from the database so every time that Post is viewed
we simply read the cached data, fine easy enough delete that data cache on
update so we always pull new data.

***But***

If the action is cached do we need to cache the query data also? The view
holds the data so if the view is cached as the final product does cake still
try to get the database query. I guess think of a cascade effect if the
action is cached for x amount of time does that override the view and query
cache since that action and the query inside the action would not even be
run since the total "action" and everything inside is cached whatever is
inside the action should be skipped all together no?

$cacheAction as it sounds would cache everything the action does, all its
thinking, data requests and result if your caching the whole action then you
don't need to cache anything else?

Cacheing you query is just the data from the db in a file / memory wherever
you save it

View just the rendered output with the query data in it

$cacheAction = view/123 => 1 month whatever for a rough example


function view ($id) {

//after initial first time viewing of this page everything inside here would
be completely skipped?
If your caching the total actions end result why would you cache the query
data? Would it not be cached inside the action already?

}

I guess with the available options it can be a bit confusing and knowing
when to use with what and when.

Any insight to clear this up would be great.

Thanks all,

K

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to