Re: Sending a lot of data to remote site

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ryan A wrote:
Hi,

I need to send an array of data to a remote site from
my script, the array will contain anything from 1 to
5000 entries of less than 150 alpha numeric characters

Ok dude, braindump coming up - just some random thoughts and ideas,
no concrete answers:

5000 * 100 = 500000 bytes - i.e. on average about half a meg,
that less than many image uploads. so a POST could be acceptable.
serialize will add to the ammount sent (and there is the
security issue of unserlizing data) but you can POST serialized
data as easily as anything else...

what options do you have for the having over the data?
what is the structure of the data you need to send?

you might consider a custom 'serialization' that minimizes the
ammount of extra data being sent e.g:

$arr = array('123', '456', '789');

send( join('|', $arr) );

// instead of

send( serialize($arr) );

yuo could consider JSON notation (probably more compact than serialize) -
and in the process maybe even be the first guy to use JSON for server to
server comms :-P

you could setup an XML feed that they can request at their leasure.

you could also skip the webserver and go directly to using FTP or SCP
or something like that (would require a line or 2 of shellscript - using gzip
to compact the data can also be very helpful

the question as too whether this is alot to send depends on how
often you need to send it - at once a day 1/2 a meg is peanuts in terms
of traffic between 2 servers hanging on the backbone (or there abouts -
by which I mean neither server is stuck behind some puny dial up or similar
connection)

whatever you do plan time to test alternative strategies before going full on
and building a fully functional 'whatever'
each.

Can you suggest the best method of doing this?

well the answer is probably not pigeons. or hedgehogs ;-)


Am looking at serialize() or a normal POST using some
of the publicly available classes, but before i take a
big step and regret it I would like to know your
suggestions, recommednations and warnings.

Thanks in advance.
-Ryan


------
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)
-----
Fight back spam! Download the Blue Frog.
http://www.bluesecurity.com/register/s?user=bXVzaWNndTc%3D

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux