Automatically switch long requests to AJAX POST