Direct HTML Delivery: Serve Cached Pages Without PHP
Direct HTML delivery lets the web server send a cached page without starting WordPress. For a visitor the page arrives faster, because PHP and the database are not used. The option is in Baza Helper > Cache & Optimization, in the card Direct HTML delivery, at the very bottom of the tab.
Direct HTML delivery is a Pro feature. The Pro, Plus and Agency plans include it. Add your licence key on the Pro tab to turn it on.
Before you start
- Page caching and automatic invalidation must be on. The plugin refuses to turn direct delivery on without them.
- The server must be Apache or LiteSpeed (one-click install), or Nginx (manual setup). Nginx has no .htaccess file.
- Your .htaccess file must be writable, for the one-click install.
Turn it on
- Press Install the rules automatically. The plugin saves a copy of .htaccess, writes the rules in front of the WordPress block, and tests that the home page still answers.
- Press Check server compatibility. The check runs in a separate request, because only a request that goes through the new rules can see them.
- Turn on Serve HTML directly without WordPress and save. The checkbox stays disabled until the check has passed.
If the check fails, the previous .htaccess is put back and the screen says so. Your host may not allow these rules. Use the manual instructions in that case.
How long a direct copy is served
The setting How long a direct copy is served chooses a time slot: 1 minute, 10 minutes or 1 hour. Each page is saved as a file for one slot. The first visit in a slot goes through WordPress and saves the file, and every other visit gets the file directly. A longer slot means fewer slow first visits, which matters on a site with little traffic. After changing the slot, install the rules and check the server again.
What the rules skip
Direct delivery is used only for public GET requests without cookies that make the page personal, without authorization, and without URL parameters. Admin requests, API requests, POST requests and other URLs keep the normal WordPress fallback. A change of content removes every saved copy at once.
Nginx
Nginx has no .htaccess, so the tab shows the rules for the Nginx http block and the server location. Copy them into the server configuration, or ask your host to do it. The rules need the http maps, the server locations and the PHP FastCGI parameters. Test the syntax, reload the server, and then run Check server compatibility.
Remove the rules
Press Remove the rules and confirm. The plugin takes out only its own block from .htaccess and leaves the rest of the file alone. Then turn off Serve HTML directly without WordPress.
Messages you may see
- The .htaccess file is not writable: make the file writable, or copy the rules into it yourself.
- Could not save a backup copy of .htaccess: nothing was changed.
- The site stopped answering with the new rules: the previous .htaccess was put back. Your server does not accept these rules.
