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

Reply via email to