I have a webapp, and i'm 99% sure what the next page is that the user is going to visit. This page has to get a lot of data from API's and also has to render it. Since this takes some time I would like to prefetch/preload the page.
I did some research and read this article. The prerender tag does exactly what I want.
Sadly it isn't supported on the stock android browser.
Since i'll be making a android app out of it, it has to be supported. I was wondering if there is a JS framework or maybe something like CrossWalk-project. That can do this.
On the server side, render the page and flush the response. Then load the data and put it into the session. You can do that in a background thread (don't forget the necessary synchronization) or you can keep the current request open until you're done. The user might see a "still loading" animation in the browser but the current page will be complete, so it shouldn't bother them too much.
If the next page loads, look into the session. If the data is already there, use it. If not, user has to wait.
That said, you should also check your data model and your database indexes and queries. Often, you can bring their execution time down dramatically by adding more indexes or optimizing SQL queries.