WP Alpha servers run the Nginx web server in front of Apache, a combination that balances performance with compatibility. By default Nginx passes each request to Apache and caches static results such as images, CSS and JavaScript. An optional setting lets Nginx serve those static files straight from the server’s disk without involving Apache at all, so the web server does less work for every request.
This optimisation is most useful if your site has a lot of files or heavy peak load traffic. Note that it may not be compatible with a WooCommerce or membership site that protects particular types of content. In the video we exclude .zip files because the example site is a membership site that needs to protect them.
Step by step
- Log in to the hosting admin console and open the site you want to change.
- Go to the Hosting & DNS tab and open Apache & nginx.
- Tick Serve static files directly by nginx, then click OK.
- A list of file extensions appears. These are the file types Nginx will now serve directly from disk. Read through it.
- Remove any extension your site protects. In the video, zip is removed because only logged-in members are allowed to download zip files on that site.
- Click OK again to save.
When not to use it
Some sites run a check before handing over a file. A membership site confirms the visitor is logged in, and a WooCommerce store may confirm a download was paid for. That check happens in PHP, which runs through Apache. When Nginx serves the file directly it skips PHP completely, so a protected file would be available to anyone who has the link.
If your site protects downloads, either remove those file extensions from the list as shown in step 5 or leave the setting off. Take the same care with any site people log into or that is otherwise more dynamic.
Sites that suit this setting
A regular content site, where nobody logs in and nobody buys anything, is a good fit. Images such as JPEG and PNG files, video, CSS and JavaScript are all handled well this way. The benefit is greatest on sites with many image files or bursts of visitors arriving at once, because the web server has less to do and can handle more traffic.
If you have questions before you turn this on, our support team can help: log a ticket from the client area or start a live chat.
