I am exploring the possibility to develop a web app that can download most of the data necessary behind the scene and at the initiation to increase user experience.
How exactly does gmail implement this features? I know it uses lots ajax, and you can see it working by Firebug->net
But I still not very clear.
How to use Yii framework to achieve to implement the similar effect?
Here’s how I usually do this, mind you this is purely the JavaScript side of it:
[list=1]
[*] On document ready, execute a function that searches the DOM for internal links (e.g. all links that don’t start with http://)
[*] For each of these links, create a new DIV whose ID is the link href target and whose content is the linked page’s content. You probably only want to load a part of the linked page, for example the main div (#content or whatever).
[*] Bind a function to these links, that executes when they are clicked. Instead of following the link, this function swaps the content of the main container (#content) with the content of the container whose ID matches the href of the link we just clicked.
[/list]
Be aware that this example is simplified and probably doesn’t work out very good if you have lots of dynamic content. I mainly used it for static pages.
Gmail uses GWT framework, where you write code in Java and GWT convert it to javascript code. Take a look if you want to develop gmail like app - http://code.google.com/webtoolkit/
Otherwise you can also try to use Yii with some javascript framework like Sammy (http://sammyjs.org/)