We are using nginx with php-fpm. We plan to make first page static (generate html file). if we have 100 concurrent connections, how we can handle file regeneration? basically we need generate new file index_new.html, then delete index.html, and then move index_new.html to index.html. What happens when index.html file was deleted? User gets 404 error? Or nginx handles file from OS cache? One idea is to tell nginx, that 404 error is index_new.html and then not to move index_new to index, but copy. But i don't like idea about 404 error.



The Unix rename() system call, which is used by the mv command, is atomic. So if you use mv index_new.html index.html then no requests will be missed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.