使用UDP方式上传/下载文件
我们有基于 Web 的 j2ee 应用程序,允许文件上传/下载。由于延迟问题,许多用户的上传/下载速度较慢。
1)我读到使用UDP发送数据可以提高数据传输速度。我们如何使用UDP发送文件数据?
2) 我们在上传/下载之前使用 GZIP 压缩文件,以减少数据传输量。有没有更好的方法可以提高数据压缩?
We have web based j2ee application which allows file upload/download. Due to latency issue upload/download is slower for many users.
1) I read that sending data using UDP can improve data transfer speed. How can we send file data using UDP?
2) We are zipping file using GZIP before upload/download to reduce amount data transfer. Is there better method available improve data compression?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
UDP 是一种不保证消息到达的协议。您很可能使用标准文件传输协议,例如 ftp,它应该很适合您。您的问题是延迟还是带宽?您可能最好调查为什么链接存在高延迟或带宽问题,因为这可能证明是 Web 应用程序其他部分的问题。
如果您愿意忍受初始压缩成本,GZIP 和其他压缩工具可以有效减少发送的数据量。这些工具应该有选项,以便您可以调整压缩级别(即花费很长时间并进行最佳压缩,或者快速压缩但压缩文件更大)。您可能需要进行试验,看看哪种平衡最适合您。
UDP is a protocol that does not guarantee the arrival of messages. You are most likely using a standard file transfer protocol like ftp which should suit you fine. Are your issues with latency or with bandwidth? You might be better of investigating why the link has a high latency or bandwidth issues, as this could prove to be an issue with other parts of your web application.
GZIP and other zipping tools are good for reducing the amount of data that is sent if you're willing up put up with the initial cost of compressing. These tools should have options so you can tweak the level of compression (i.e. take a long amount of time and compress optimally, or compress it quickly but have a larger zipped file). You will probably need to experiment and see what balance works the best for you.
是的,UDT 是主要示例,但它不是自由交易,例如考虑您现在需要自定义下载文件的前端应用程序。
是的,请访问 http://www.maximumcompression.com/index.html 查看详尽列表, bzip2 和 7-zip 是 gzip 的流行替代品。
请注意,对于特定领域,例如文本、照片图像、扫描文本,有更优选的领域特定编解码器。
Yes, UDT is the primary example, but it is not a free trade, for instance consider you now need a custom frontend application to download files.
Yes, view the exhaustive list at http://www.maximumcompression.com/index.html, bzip2 and 7-zip are popular alternatives to gzip.
Note for specific domains, such as text, photographic images, scanned text, there are domain specific codecs which are more preferable.