I’m creating an web application that need to have fast response time for each click, so the user experience is as good as possible. Doing a postback or callback for each button clicked is too slow. I have had some different ideas how to accomplish this and I it is ok to have a higher initial load time, but not sure how to do this best.
One of my ideas is to load as much as possible of the data on the initial load and just show/hide divs when the user click the menu. If the data is to old I would refresh it with an ajax callback. The idea seems ok, but now sure how to accomplish this. I would prefer being able to separate my code into different controls or else I will get one huge controller, and that can be messy.
Would it be possible not load <?php echo $content; ?> in the layout file and just call each controller/action I need separately from the layout file and hide them? If so what would be the command to call the controller/action from the layout file. Or should I actually drop $content but load all data as widgets? But if so would it be possible to reload the widgets with an ajax callback?
I have multiple other ideas, but many are a bit far fetched
Do any one have some of the answers or some totally different suggestions?
Thanks.