Did you know that since WP Rocket 1.0, you no longer have to configure Nginx to use WP Rocket? It’s all thanks to Maxime Jobin and a chance meeting at the 2014 WordCamp Montreal. Back then, Maxime was preparing for his advanced talk on Performance with Nginx. He met Julio and Jonathan from our team.
So, Rocket-Nginx was born…
We’d love to say that it was the irresistible charm of our co-founders that made Maxime go home and buy a license but it’s probably WordPress caching that caught his interest. Maxime knew he could make WP Rocket better by creating a specific Nginx configuration where cached files could be served directly (without calling WordPress or any PHP). That would make websites using WP Rocket faster. The first version of Rocket-Nginx was released in December 2014.
Two years later, Maxime just released version 2.0!
Rocket-Nginx Configuration 2.0
So what’s new with Rocket-Nginx? The new released version had focus on flexibility. That is why a configuration file (rocket-nginx.ini) and PHP parser were added. That way, users can now generate a “default” configuration based on values that are used by most websites but can also generate specific configurations by extending the default configuration.
The script must be included in the NGINX configuration. You only need one instance of Rocket-Nginx to take care of all of the WordPress websites using WP Rocket. Once you clone the project from GitHub, it is as simple as:
- Generating your Rocket-Nginx configuration file;
- Including that file in your Nginx configuration.
WP Rocket, NGINX and SSL (HTTPS)
Wondering if your website will work correctly if you are using an SSL certificate? The answer is yes! Rocket-Nginx will detect requests made through HTTPS (or not) and serve the file that matches the request type.
Optimizing Your Configuration
The NGINX configuration works out-of-the-box but the rocket-nginx.ini file is filled with options you can edit to suit your needs.
Disabling WP-Cron Jobs
Rocket-NGINX configuration has one goal: to serve cached files directly without having to execute any PHP from WordPress. This in turn may cause scheduled jobs to not be called. In order to make sure scheduled tasks are performed properly, we recommend you disable WordPress cron jobs and replace them with a real cron job. To this this, we suggest you head on over to Maxime Jobin’s instructions on Github.
What if I am using Apache’s .htaccess?
Well, Apache is a different webserver. We suggest you check out the Apache section of our documentation. It contains great information on how to leverage browser caching and information on how to fix some of the common problems that come with WordPress caching.