this approach could work too, but you don't know in advance which page the user clicks next, so you'd have to pre-load all currently available pages, which would lead to unnecessary server requests.

The hostname thing was solved by this if anyone runs into the same problem:

  view_cache_manager:
    class: sfViewCacheManager
    param:
      cache_key_use_host_name: false



On 2/11/11 10:27 AM, Gareth McCumskey wrote:
Why not just chain ajax requests? Have two divs, one visible one invisible. Load what the person wants to see with one ajax request. When that completes it calls another ajax request which loads the next page into the invisible div. When the person goes to the next page, the act of making that page visible starts loading the next page into the hidden div.

2011/2/10 Robert Gründler <r.gruend...@gmail.com <mailto:r.gruend...@gmail.com>>

    Hi,

    Imagine a blog where each BlogEntry has one Author, and can be
    tagged with one ore more Tags.
    The mainpage displays a paginated list of all blogentries. Every
    entry displays the title, author and the tags. The pagination
    is implemented using AJAX.

    To display the paginated list using symfony + doctrine, 3 Database
    queries are needed:

    1. select count(*) .... # get the total number of entries
    2. select distinct ... limit ... offset # get the actual ids of
    blog entries for that page
    3. select ... where in (...)  # retrieve the data to display for
    that page

    When the number of blogs and the authors + tags is getting large,
    these 3 queries can take up to 800 - 1000 ms, which is
    not fast enough, if you want ajax pagination.

    If a single page is cached, the ajax request takes about 200 - 300
    ms, but the uncached page takes over 1 second to load.

    What we're thinking about is to "pre-fill" the cache of every page
    in that list, so that no user ever hits an uncached page. This
    "pre-fillling"
    could take place in a cronjob, which is run every 5 minutes or so
    - frequent enough for this use case.

    What i was thinking about is to set the cache-lifetime of the
    partial for a single page to one day, and update the cached results
    in the background - which actually is the part i'm not sure how to
    implement.

    Anyone knows if this kind of logic could be implemented using
    symfony + doctrine?

    thanks!

    -robert

-- If you want to report a vulnerability issue on symfony, please
    send it to security at symfony-project.com
    <http://symfony-project.com>

    You received this message because you are subscribed to the Google
    Groups "symfony users" group.
    To post to this group, send email to
    symfony-users@googlegroups.com <mailto:symfony-users@googlegroups.com>
    To unsubscribe from this group, send email to
    symfony-users+unsubscr...@googlegroups.com
    <mailto:symfony-users%2bunsubscr...@googlegroups.com>
    For more options, visit this group at
    http://groups.google.com/group/symfony-users?hl=en




--
Gareth McCumskey
http://garethmccumskey.blogspot.com
twitter: @garethmcc
identi.ca <http://identi.ca>: @garethmcc

--
If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

--
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to