I usually make the suggestion that “a web-page should be thought of as a user-interface, nothing more.” If there is “more” to be done, then the web-page interface ought to be used to initiate it, to monitor it, and to retrieve the results from it (whenever the user cares to stop by again and (s)he sees that the work is now complete), but the web page should never be the one to actually do it. Some other background-processing engine, and there are a great many to choose from, should be doing that part of it. Ideally, everything that a single web-page HTTP transaction should be asked to do, should take only a few milliseconds between request and response. Even if the user checks back hours later or the next day, the results should be there waiting to be picked up.