On Friday 29 May 2009 12:50:09 Mary Nicole Hicks wrote:

> > What's the problem with retrieving the entries from the DB, Assigning
> > them into a multi dimensional array and passing it into the
> > zend_nagivation?
>
> The problem is that I can not do this for every navigable page on the site
> all at once... for every request.
>
> 1. Memory due to lots of items.
> 2. Speed - there comes a point when an array is so large that it is not as
> fast as an indexed mysql database table.
> 3. Cache will get out of date quickly.
> I have multiple situations like this on the same site and as new pages are
> being created, moved, renamed quite often, any caching would not be up to
> date for very long at all.

Offtopic, but I've noticed people don't consider destroying the cache when it 
becomes obsolete. For example, lets say you have an article overview and an 
article view, lets say there a title, lead and # of comments on overview and a 
full article with all it's comments on view.

When displaying the overview, you go for the cache and miss, so we really need 
to render this one ourselves. Go through the rendering and remember each 
item's ID. When you're done, store the rendered item in cache and tag it with 
those IDs (for example, article_XXX), same thing on the view of the article.

When something changes (someone edits the article, someone leaves a comment), 
you destroy all cache entries by tag:

$cache->clean(
    Zend_Cache::CLEANING_MODE_MATCHING_TAG,
    array('article_XXX')
);

which will destroy the overview page which holds that article AND the article 
view page. With proper situation, usage and the static backend (which is a 
great idea IMHO)  [1], an application could have it's cache lifetime set to 
eternity and be really fast.

Anyway, we apologize for this interruption and return to our regular 
program.... :)

> Creating a navigation tree of every page in the site is not possible for a
> large site. If the Navigation object is only getting used to show related
> pages such as parents (breadcrumb) and children (menu). Why should it need
> to be loaded with tonnes of unrelated pages?

I don't fully understand the problem you're trying to solve. 

[1] http://sn.im/j0c9x

-- 
Dado

Reply via email to