The developer claims that by injecting the Rocket-Nginx configuration, then page cache which has been created by WP-Rocket will be sent directly to visitors without having to call WordPress or PHP. If this is the case, then we can be sure that if only Nginx is working, it will lighten server performance and can increase server stability.
However, is the developer's claim true? That's why I did a test with the conditions before and after using Rocket-Nginx.
Before Using Rocket-Nginx
For this test I created a server on OVH; install Nginx, MySQL, PHP 7.4, WordPress, Zakra Theme + WP-Rocket.
And if we test with Curl, the result without Rocket-Nginx will be like this:
And for the test, I use Loader.io services, with 250 clients. And the test results are as follows:
We can see that the PHP process is quite high, even though the webserver uses Nginx. To send the page cache to visitors, it still requires PHP intervention.
After Using Rocket-Nginx
If we have injected the Rocket-Nginx configuration into Nginx, the curl result will be as follows:
You can see that an additional header will appear in the form "X-Rocket-Nginx-Serving-Static: Yes". If what appears is Yes, then the page cache is successfully handled by Nginx and will be sent to the visitor without any PHP process. However if No., then it is the opposite, Nginx still uses PHP interference. But this only applies to page cache only, for other static files such as css, js, images, etc .; then what appears is confirmed to be No.
Same as the previous test, I used Loader.io with 250 clients, and the results are as follows:
With Rocket-Nginx, only 2 PHP processes exit and even then it doesn't work, because you can see the number resource CPU used 0 percent. Nginx is the one who sends it page cache to visitors, according to the claims mentioned by the developer.
Using Rocket-Nginx is highly recommended if you are using Nginx & WP-Rocket for your WordPress site. Use resource CPU is much less, so that is certain the server will be more stable and able to runhandle more visitors.
If you are interested in installing Rocket-Nginx, please visit this page.