在浏览器中得到此net :: ERR_EMPTY_RESPONSE错误 [英] getting this net::ERR_EMPTY_RESPONSE error in browser

查看:409
本文介绍了在浏览器中得到此net :: ERR_EMPTY_RESPONSE错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用gem"paperclip"上传图像,并使用gem"paperclip-storage-ftp"将图像存储在自己的ftp服务器上.我成功上传了多张照片,并且也将其保存在我的数据库中而没有任何错误.

I used gem "paperclip" for upload images and gem "paperclip-storage-ftp" for store images on my own ftp server.I got success to upload multiple photos and it's saved in my database too without having error.

但是当我去显示照片页面时,我可以看到一些适当的照片,但是

but when I go to show photos page there i can see some photos proper, But

大多数照片都坏了,而在这样的浏览器控制台中却出现了很多错误

some most of photos are broken, and i am getting so many error in browser console like this

Failed to load resource: net::ERR_EMPTY_RESPONSE

如果您对此有任何解决方案,请帮助我.

help me if you have any solution for this.

谢谢.

推荐答案

异步处理图像

问题

我也发生了同样的事情.我发现上传大文件不是问题,而是Paperclip上传后处理文件的问题.

Process Your Images Asynchronously

The Problem

I had the same thing happening to me. I found out that uploading large files were not the issue, it was the processing of the files after the upload by Paperclip that was the problem.

当浏览器正在主动上传(或下载)文件时,浏览器没有问题,可以使连接保持活动状态,但是Paperclip在上传文件后花很长时间来处理文件,浏览器认为这没有任何反应.因此,如果处理时间过长(〜1分钟),浏览器会认为出了点问题,并返回了 ERR_EMPTY_RESPONSE .

The browser has no problem keeping the connecting alive when it is actively uploading (or downloading) a file, but Paperclip was taking too long to process the files after they were uploaded, which the browser interprets as nothing happening. So if that processing takes too long (~1 min) the browser thinks something went wrong and returns an ERR_EMPTY_RESPONSE.

我安装并实现了出色的 delayed_pa​​perclip 回形针处理异步任务.

I installed and implemented the wonderful delayed_paperclip gem, which pushes all the Paperclip processing to asynchronous tasks.

这意味着一旦上传了文件,请求就完成了,浏览器会立即得到响应,而不必等待Paperclip处理文件.

This means that once the files are uploaded, the request is completed and the browser gets an immediate response instead of waiting for Paperclip to process the files.

问题解决了.

这篇关于在浏览器中得到此net :: ERR_EMPTY_RESPONSE错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆