How about writing a rake task that generates the sitemap file and running
this rake task periodically through a scheduler (say, Cron)?

On Wed, Feb 16, 2011 at 7:35 AM, swartz <[email protected]> wrote:

>
>
> On Feb 11, 10:49 am, Anton J Aylward <[email protected]> wrote:
> >  <r:children:each  order="asc">
> >    <r:unless_content part="no-map">
> >      <li>
> >        <r:link />
> >      </li>
> >        <r:if_children>
> >          <ul>
> >            <r:snippet name="sitemapper" />
> >          </ul>
> >        </r:if_children>
> >      </li>
> >    </r:unless_content>
> >  </r:children:each>
> >
> > Yes, its still recursive, there no way round that for a general
> > algorithm.  Perhaps "children:each" is faster than "nav"
>
>
> I tried the above code and did some apachebench tests with cache
> busting.
> Doing this yields marginally better result. Not by much.
>
> > I suspect a lot of your time is because the site is deeply nested.
> I checked the content structure. We have at most 4 levels of page
> hierarchy, including the homepage
>
> Homepage
> -- Level 2
> ---- Level 3
> ------ Level 4
> ------ Level 4
> ---- Level 3
> -- Level 2
>
> I wouldn't consider this very deep.
>
> In any case, so far my ideas to improve the performance:
>
> A) Write an extension that will load just the necessary attributes
> (page title, slug, and position) from the whole page result set (minus
> no-map pages).
> Then process the in-memory result set instead of recursively expensive
> database calls for each page's children. Shouldn't cost too much
> memory usage even with 10k pages.
>
> B) Write an extension that will force sitemap cache to be rebuilt
> every time a page is modified and is not a 'no-map'.
>
>  Any other ideas?

Reply via email to