Improve Performance

Authentications , When you want download my files you must purchase account and then you can download

I see. Perhaps this is of interest to you?

Yes , I see this article before , This is very good solution but I have 2 problem with this

1-This option is disabled by default as it’s still not a standard feature.

2-The disadvantage to using X-SendFile is that you lose control over the transfer mechanism. What if you want to perform some tasks after the client has received the file? For example: to allow a user to download a file only once. With X-Sendfile this could not be done because the script continues to run as soon as it sends the file to the web server for processing and so the script could not know if the download was successfull.

Problem #1 is not important , but #2 is important because I want log Usages

Ah, well. Then dump Apache for nginx: http://wiki.nginx.org/HttpSecureLinkModule

In this module I think I must change my URLs like

and add something after URL for authentication but unfortunately I dont have access to change download URL

Problem #2 with XFileSend solved just ‘terminate’=>false needed




Yii::app()->request->xSendFile($file,array(

            'terminate'=>false,

        ));



Now I test my script again and I dont know Why it need again 1.2 - 1.5 Sec for 2MB file

Is this Probability true ? I think xSendFile dont works good in Windows environment and if I test in Linux download time will reduce (May be less than 0.2 Sec), Right ? or not ?

reply Please

How so? You should be in power to change the generated link?

The functionality should not be effected by the underlying OS. Despite the name, X-Sendfile is unrelated to the Linux kernel’s sendfile mechanism.

If it takes that long, I’d suspect a configuration issue. But that’s impossible to diagnose with the information you gave.

It is a little complex to explain How ? I can just tell my client’s have a list and want download list daily or twice per day

So links are fixed and it is impossible for me to changes links

Ok, I am trying to find problem and solve it , thanks