I''m posting a request with the Ajax.Request method to my PHP 5 server, which in turn returns a large chunk of JSON (11509 characters), by using the X-JSON header. It seems that the connection is choking up on this piece of data, because I''m not getting a response when I check my Firebug console. When I''m using a smaller slice from the same dataset (6949 characters), the response is just fine and works as expected. I''m not quite sure how to solve this problem. I''ve tried the following methods to no avail: - Set the ''Keep-Alive'' property in the requestHeaders option in Ajax.Request from default 300 to 900 - Tried switching from ''post'' request to ''get'' request in the ''method'' property of the Ajax.Request object - I''ve set the following header in my PHP script while outputting the data: header(''Keep-Alive: timeout=25, max=710''); Is there an option somewhere to set the maxium size of the response to a higher value? Are there any other things I''m overlooking? Your help will be greatly appreciated! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Tobie Langel
2007-Oct-03 23:29 UTC
Re: Large chunk of JSON not arriving on client with Ajax.Request
Don''t use the X-JSON header. Send the JSON as the body of your response. Tobie On Oct 4, 1:08 am, Nixsos <jvkers...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''m posting a request with the Ajax.Request method to my PHP 5 server, > which in turn returns a large chunk of JSON (11509 characters), by > using the X-JSON header. > > It seems that the connection is choking up on this piece of data, > because I''m not getting a response when I check my Firebug console. > When I''m using a smaller slice from the same dataset (6949 > characters), the response is just fine and works as expected. > > I''m not quite sure how to solve this problem. > I''ve tried the following methods to no avail: > - Set the ''Keep-Alive'' property in the requestHeaders option in > Ajax.Request from default 300 to 900 > - Tried switching from ''post'' request to ''get'' request in the ''method'' > property of the Ajax.Request object > - I''ve set the following header in my PHP script while outputting the > data: header(''Keep-Alive: timeout=25, max=710''); > > Is there an option somewhere to set the maxium size of the response to > a higher value? > Are there any other things I''m overlooking? > > Your help will be greatly appreciated!--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---