jQuery ajax crashes chrome on HTTP 206 (Partial content) -
this thing has been bugging me time , can't find reason/solution on web far. here setup:
i have fat js client running on browser, firing search requests internal system. requests get's, nothing special. return url search results put once available.
i poll given url results (from time time, every 5 minutes) , process data presented user. url points gzipped results file plain text (ascii).
now... search results within few hundred lines of text, there hundreds of thousands of lines of text, @ times 7-10mb worth of text (after unzipping). , that's browser shows sad-tab page.
(no need point out security issues approach, numerous , highly potent).
nothing special there - calling a
$.ajax({ url: '/cgi-bin/ajax_gz.cgi', type: 'post', data: 'curl -k "' + self.url_res + '"', datatype: 'html', success: function (_data, _status, _xhr) { self.update_result(_data, _status, _xhr); }, error: function (_xhr, _status, _error) { self.set_status(status.ack); }, timeout: 5 * one_minute }); where ajax_gz.cgi nothing more elaborate simple dumb proxy (to allow js pull data different domain relaying curl requests):
#!/bin/bash echo "content-type: text/html" echo "content-encoding: gzip" echo "" /bin/bash the return indeed gzipped html, i'm setting header that. suppose update headers in ajax()'s config, seemed simpler approach.
the success or error functions never called , timeout (5 minutes) not problem - it's on lan , whole transfer takes less half minute.
i can open url in tab no problems @ all, , shows me unzipped plan ascii text. when retrieving data jquery's ajax() i'm facing sad-tab page (almost every time, "partial content" http 206 responses).
what missing? trying "step through" in js debugger doesn't sudden sad-tab , debugging session killed.
update: stepping through jquery's code , stopping @ readystate===4's function able catch response. http 200 full text (from opening <html> tag way closing 1 108k lines in-between in single <pre> tag). once got response , tried "expand" this value got sad-tab page
i think running chrome memory limitation. accoding this chrome might have limitation of 3000 characters ajax calls.
as you've noticed developer tools shows all, when reading returned jquery hits form of ceiling. can try limiting response under limit see if works? perhaps try browser?
if issue, try returning results in parts. few parts returned might around limitation.
Comments
Post a Comment