Hi,

I would make it using a task which uses sfBrowser on the ajax urls,
eventually using DB queries to generate them. If you use html cache it
should do the job. The only thing is to run the task with the good env
argument so it generates cache for 'prod'.

Now if you use sfViewCacheManager, it seems you can do it more naturally
when a new post is created, with setPageCache <goog_277624711>
<http://trac.symfony-project.org/browser/branches/1.4/lib/view/sfViewCacheManager.class.php#937>
method.


Regards
Benoit

2011/2/10 Robert Gründler <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
>
> 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