We have an AJAX “contact form” that currently on submission emails form data to a mail-list and adds the data to Google Spreadsheet using Zend Gdata.
The issue is that the Zend Gdata is a big bottleneck–it adds almost 5 seconds to the submit process.
Is there a way to configure this to be done asynchronously or is there a better way to accomplish this not using Zend?
I assume the problem here is you don’t want the user of the web application sitting there and waiting for this whole linear process to be completed (5+ seconds).
There are a number of ways you could tackle this problem without really needing to replace Gdata (and write something of your own which may or may not be able to perform better).
You could simply place the data in a queue of some sort (in database, in file system, whatever), and you could then periodically run a script to populate the data into the GoogleDocs as a separate process. This would allow you to return a sucess message back to the web app without having to wait for the Google Docs update.
Alternatively, you could fork a process in PHP which could perofmr the Gdata update, while allowing to response to be returned to the calling AJAX request independently.