Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: Good method to pass files throught perl/cgi script ?

by Martin90 (Sexton)
on Jul 11, 2013 at 10:17 UTC ( #1043683=note: print w/ replies, xml ) Need Help??


in reply to Re: Good method to pass files throught perl/cgi script ?
in thread Good method to pass files throught perl/cgi script ?

No, what I am doing is very server-related. I want to have content on my server since I have my own music player + statistic of downloaded files. ALso I would like to control if files was downloaded completely + need to control download speed and so on. So, if I use nginx along with apache and pass files thru nginx with XSendfile, would it help much ? Maybe there are other options ?


Comment on Re^2: Good method to pass files throught perl/cgi script ?
Re^3: Good method to pass files throught perl/cgi script ?
by thomas895 (Hermit) on Jul 11, 2013 at 23:24 UTC

    As far as I know, you can't control or even see the download speed in a CGI program. Your script just reads and outputs the whole file to STDOUT, which the server then just passes along to the client. The server probably buffers it, too, so the time it took for the file to be output does not necessarily have to be the time it really took to download. Sendfile won't tell you that, either.

    As far as statistics go, you can write or use a logfile analyser, then count how many times each file was downloaded and by whom, etc.
    Fun fact: you can also add query parameters to the static file locations, and most webservers will not do anything with them by default. Use this to add extra info that you might want to analyse later.

    ~Thomas~ 
    "Excuse me for butting in, but I'm interrupt-driven..."

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1043683]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (8)
As of 2014-10-01 14:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (26 votes), past polls