Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sending large files via HTTP

Tags:

http

php

xml

I have a PHP client that requests an XML file over HTTP (i.e. loads an XML file via URL). As of now, the XML file is only several KB in size. A problem I can foresee is that the XML becomes several MBs or Gbs in size. I know that this is a huge question and that there are probably a myriad of solutions, but What ideas do you have to transport this data to the client?

Thanks!

like image 503
CoolGravatar Avatar asked Dec 14 '22 06:12

CoolGravatar


1 Answers

based on your use case i'd definitely suggest zipping up the data first. in addition, you may want to md5 hash the file and compare it before initiating the download (no need to update if the file has no changes), this will help with point #2.

also, would it be possible to just send a segment of XML that has been instead of the whole file?

like image 85
Owen Avatar answered Dec 15 '22 18:12

Owen