Remembering vagrant Nginx Sendfile problem

Source: Internet
Author: User
Tags sendfile

From this year onwards, we have been developing on vagrant virtual machines.

The browser refresh does not take effect when a static file is modified because a project needs to debug a static file in the previous period.

The last trace is that Nginx opened the sendfile.

Specific Sendfile principle can be checked,, on-line writing is very detailed, here is no longer described.

At first, there was a problem with the configuration of nginx somewhere. But then you just write it down and do the test.

The specific code is as follows (TCP that few steps connect here does not write.) Many online):

/** * @connect TCP connection handle*/intSendclient (intConnect) {    intFD; structstat Filestat; off_t Offset=0; FD= Open ("/data/web/test.com/index.html", o_rdonly|O_nonblock); if(FD <0) {perror ("open file."); return 0; }    //Get file InformationFstat (FD, &Filestat); CharBuffer[filestat.st_size]; //Read (fd, buffer, filestat.st_size); //Write (connect, buffer, filestat.st_size);Sendfile (Connect, FD, &offset, filestat.st_size);    Close (FD); return 1;}

To some I measured, get or do not take effect, it can be concluded that the nginx is not related to the system scheduling

As for the question, my answer now can only be a pit of vagrant, what is specific, I also do not know,

Of course, this I also from the appearance of speculation, if someone knows the real reason, also please leave a message to advise

Remembering vagrant Nginx Sendfile problem

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.