is the principle of jumping the request to a file on the server where the Web application ends before the server sends the file, and to invoke Yii\web\response::xsendfile () to use the feature. The following is a brief list of how some common Web servers enable X-sendfile features:
Apache:x-sendfile
Lighttpd v1.4:x-lighttpd-send-file
Lighttpd v1.5:x-sendfile
nginx:x-accel-redirect
Cherokee:x-sendfile and X-
;
void (*abort_request) (ngx_http_request_t *r);
call void (*finalize_request) at the end of the request (ngx_http_request_t *r,
ngx_int_t RC);
The redirect function ngx_int_t (*rewrite_redirect) (ngx_http_request_t *r) that can be implemented by the HTTP module
ngx_table_elt_t *h, size_t prefix); ngx_int_t (*rewrite_cookie) (ngx_http_request_t *r, ngx_table
_elt_t *h);
ngx_msec_t timeout;
registry regedit click Directory to:Hkey_local_machinesoftwaremicrosoftwindowscurrentversionrunRemove the right Dirrectlibrarysupport = "C:windowssystemdllclient.exe" to turn off Regedit and restart the computer.DEL C:windowssystemdllclient.exe OK Clear Trojan v2.0 open registry regedit click Directory to:hkey_user/. Default/software/mirabilis/icq/agent/apps/icq Accel/icqAccel is a "false" primary key, select the ICQ
Nginx configuration file protectedHeader("X-accel-redirect:/protected/".$filename);?>Here is the use of the alias, you can also use direct access to the way, specific to the Nginx official website about the xsendfile of the instructions, a look will understand!References and excerpts:1. Brother Bird: http://www.laruence.com/2012/05/02/2613.html2.nginx implementation: Https://www.markdream.com/technologies/programs/nginx-x-
; make makeinstall
2. Create the squid cache directory and log directory
Shell> groupadd squid
Shell> useradd-g squid-s/sbin/nologinsquid
Shell> mkdir/squid/data-p
Shell> mkdir/squid/log
Shell> chown-R squid. squid/squid
3. Edit the squid configuration file and configure it as the reverse proxy mode. Load the two web Servers
Shell> vim/usr/local/squid/etc/squid. conf # user and user group cache_inclutive_user inclusquid # host name visible_hostname squid1.lij.com # configure squid as reverse pr
working process, Nginx can configure fastcgi_next_upstream for failover, switch to another set of PHP-FPM services in upstream.
The PHP-FPM can be configured to listen to the pool of different ports, the working process in different pools is not affected, you can put the PHP-FPM of different pools in the Nginx upstream cluster.
Nginx is added to the AIO thread pool from 1.7.11, which can read and send files using multiple threads to prevent the worker process from being blocked. for attachments
only displayed after 256 bytes have been accepted, so you must send some extra spaces to let these browsers display the contents of the page.
So, the correct use of the two is the order. First Ob_flush, then flush,
Of course, in other sapi, do not call flush also can, only to ensure that your code portability, recommended for use.
Add a response header if you want to support on Nginx + FPM + PHP
Header (' X-accel-buffering:no '); This eliminates
logical restrictions.
To solve this problem, the XSendfile function provided by nginx simply uses the internal command. This command only accepts internal requests, that is, requests forwarded by the backend. In the backend view logic, you must explicitly write the headers information X-Accel-Redirect.
The pseudocode is as follows:
location /upload/(.*) { alias /vagrant/; internal;}@app.router('upload/
')@login_requireddef upload_file(filename
before it is displayed. For example, the Netscape browser caches content before it accepts the start of a newline or HTML tag, and does not display the entire table until the tag is accepted.
Some versions of Microsoft Internet ExplorerThe page is only displayed after 256 bytes have been accepted, so you must send some extra spaces to let these browsers display the contents of the page.
So, the correct use of the two is the order. First Ob_flush, then flush,
Of course, in other sapi, do not cal
popular Web servers enable the X-sendfile feature:
APACHE:X-SENDFILELIGHTTPD v1.4:x-lighttpd-send-filelighttpd V1.5:x-sendfilenginx:x-accel-redirectcherokee: X-sendfile and X-accel-redirect
6. Send a response
The content in the response before the Yii\web\response::send () method call is not sent to the user, which is automatically called by default at the end of the Yii\base\application::run (), although
Time will consume the CPU cycle. Therefore, if the CPU of the entire system is very full, avoid using this feature. When the network bandwidth is limited and the CPU resources are sufficient, the use of multi-threaded compression dynamic migration technology will bring better results. When the network is sufficient and the CPU resources are sufficient, using this technology will also reduce the total migration time.
3. multi-thread compression and migration technology enabling Method
Source end
until it receives the tag.
Some versions of Microsoft Internet ExplorerThe page is displayed only after 256 bytes are received. Therefore, some extra spaces must be sent for these browsers to display the page content.
Therefore, the correct order of the two users is: first ob_flush, then flush,
Of course, other sapis do not call flush, but we recommend that you use it to ensure the portability of your code.
If you want to support nginx + fpm + php, you need to add a response header.
Header ('x
Provides cache acceleration for Internet users to access enterprise Web sites.
The topology of the experiment is as follows:
Http_port 80 accel vhost http_access allow all cache_peer 192.168.1.18 parent 80 0 originserver round-robin weight = 1 cache_peer 192.168.1.19 parent 80 0 originserver round-robin weight = 1 hour squid. david. dev cache_mgr mchina_tang@qq.com
7.4 start the Squid service
Squid failed to start because the squid listening port co
to turn the car I do not introduce, online tutorials a lot more). The above said so much, in fact, is also very abstract, below a gathering elephant,. Make a simple schematic diagram of your own drawing first. Controllercontrolled EndThese two graphs are I draw to help you understand (I do this by the controlled side of the circuit, the speed is slightly slower. We can be in the drive there to make a amplification circuit, speed can go up, but can not back, we can directly use the l298n drive.
only start to appear after the 256 bytes received, so you must send some extra spaces to allow the browser to display the page content.
So, the order in which the two are used correctly is. First Ob_flush, then flush,
Of course, in other sapi, do not call the flush can also, just to ensure that your code portability, recommended supporting use.
If you want to support the need to add a response header on Nginx + fpm + PHP
Header (' X-accel
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.