I was just thinking of a potential problem that Views 3 might have and just wanted to voice it before I forget.
Now that Views supports external data sources we should consider the option to load the initial view asynchronously, similar to how the pager works but do it on the first load. The reason for this is the external data source has the potential to slow down the entire load time of the page because the page can't be rendered until the external data source is queried and returns results. If a page has multiple views with different data sources or a data source is returning results extremely slowly this has the potential to drastically slow down page load times.
Sorry if this is already being worked on, I haven't had a chance to look at the code.
Comments
Comment #1
dawehnerI also see this problem, for example if you access twitter via the api.
But there is only the possibility to use javascript to solve this problem, or not?
Afaik http://drupal.org/project/authcache tries to solve this problem.
Comment #2
merlinofchaos commentedAsynchronous loading is way out of scope. It requires javascript. This would have to be provided externally.
Comment #3
SeanBannister commentedmerlinofchaos: Am I right in saying the way to implement this would be using the same method as the pager? Basically when the view loads don't load the content just the layout and then call the first page using the same method the pager uses?
I understand this might be "out of scope" but I know a lot of people are going to experience problems with this and just wanted to get an idea on how it should be implemented.
Comment #4
merlinofchaos commentedYes. THe downside to this is that there is not (currently) an easy way to just create the ajax call that you need, and there are a bunch of variables that you'll need -- the view name, path, dom id and args. I know that people have done this before, but I don't personally remember everything that is needed to construct an ajax call (I didn't write that code) to load a view and I don't think anyone has written it up either.
So the short answer is: Yes that's what you have to do, it'll probably take you some fussing around to do it. =)