我有一個頁面,允許用戶上傳和映射CSV文件。在完成之後,行將通過後續調用發送到不同服務器上的頁面。經過近6,00次調用(5787正好)後,我開始出現控制檯錯誤「無法加載資源:net :: ERR_INSUFFICIENT_RESOURCES」。jQuery post調用導致「無法加載資源:net :: ERR_INSUFFICIENT_RESOURCES」
我試着在CSV文件中運行100行的頁面,它工作得很好......但是當我嘗試一個大列表(超過10,000行)時,它凍結了。
這裏是使得後調用的代碼:
for (var i = 0; i < manifestRows.length; i++)
{
$.post('http://www.otherserver.com/subfolder/handler.php', { tblName: 'foobar', thing1: manifestRows[i][0], thing2: manifestRows[i][1], thing3: manifestRows[i][2], thing4: manifestRows[i][3], thing5: manifestRows[i][4], thing6: manifestRows[i][5], thing7: manifestRows[i][6], thing8: manifestRows[i][7], thing9: manifestRows[i][8], thing10: manifestRows[i][9], thing11: manifestRows[i][10], thing12: manifestRows[i][11], thing13: manifestRows[i][12], thing14: manifestRows[i][13], thing15: manifestRows[i][14], thing16: manifestRows[i][15], thing17: manifestRows[i][16], thing18: manifestRows[i][17] }, function(data) {
if (data.length == 0)
{
var currentProcessing = $('#processingCurrent').html();
$('#processingCurrent').html(parseInt(currentProcessing) + 1);
var progress = Math.ceil((parseInt(currentProcessing)/manifestRows.length) * 100);
if (progress == 99)
progress = 100;
progress = progress + '%'
$("#progressBar").width(progress).html(progress);
if (progress == '100%')
{
$('#processdingDiv').hide();
$('#allDone').show();
}
}
else
alert(data);
});
}
有一些代碼,我可以把無論是在用戶端,或其他的服務器以防止此Insuffiecient資源錯誤的存在的呢?