How BerqWP Serves Cached Pages on Apache

When BerqWP optimizes a page, it saves a ready-to-serve copy of that page on your server. The next time someone visits that page, your server can deliver the saved copy instantly — before WordPress even loads. This is called server-side cache delivery, and it’s significantly faster than generating the page from scratch each time.

On Apache web servers, BerqWP sets this up for you automatically. You don’t need to configure anything.


How It Works

When you activate BerqWP, the plugin writes a set of rewrite rules into your site’s .htaccess file. These rules tell Apache to check whether a cached version of the requested page exists. If it does — and the visitor is eligible to receive it — Apache serves that file directly, bypassing WordPress entirely.

The cached file is a compressed HTML file stored at:

wp-content/cache/berqwp/html/your-domain.com/page-path/index.html.gz

Apache decompresses it transparently and sends it to the visitor’s browser as a normal HTML page.

When Apache serves from cache

Apache will serve the cached file when all of the following are true:

  • The request is not a form submission (not a POST request)
  • The URL has no query string (e.g. not ?utm_source=google)
  • The visitor is not logged in and has none of these cookies: wp-postpasswordpress_logged_incomment_authorwoocommerce_cart_hashedd_items_in_cart
  • A cached file actually exists for that page

If any condition is not met, Apache passes the request to WordPress normally.


Verifying It’s Working

You can confirm server-side cache delivery is active by checking the HTTP response headers for a cached page.

  1. Open your browser’s Developer Tools (press F12 or right-click and choose Inspect)
  2. Go to the Network tab
  3. Visit a page on your site that BerqWP has already optimized
  4. Click the request for the main page document (it will be the first item listed)
  5. Look at the Response Headers section

If you see:

X-served: server

Apache is delivering the page directly from cache.


What Happens in Sandbox Mode

When you enable Sandbox Mode in BerqWP, the .htaccess rules are temporarily removed. This means Apache falls back to WordPress for every request — useful when you’re testing settings and don’t want cached versions served to real visitors.

When you disable Sandbox Mode, BerqWP re-adds the rules automatically.


What Happens When You Deactivate BerqWP

When you deactivate the plugin, BerqWP removes its .htaccess block cleanly. Your .htaccess file will be restored to how it was before.


The .htaccess Block

If you want to inspect the rules BerqWP adds, open your .htaccess file (located in the root folder of your WordPress installation). Look for this section:

# BEGIN BerqWP Cache
...
# END BerqWP Cache

This block appears above the WordPress block (# BEGIN WordPress). Do not edit it manually — BerqWP manages it automatically and will overwrite any manual changes on the next cache flush.


Common Issues

The X-served: server header isn’t appearing

If you’re not seeing the X-served: server header, check the following:

  • The page may not be cached yet. BerqWP caches pages as they’re visited. Visit the page once to trigger optimization, then check again.
  • You may be logged in. Logged-in users are always served by WordPress, not from cache. Open the page in an incognito/private browser window.
  • The URL has a query string. If the URL contains parameters (e.g. ?preview=true), the cache is bypassed. Try the clean URL.
  • Sandbox Mode is on. Check BerqWP settings and disable Sandbox Mode if you want to test live cache delivery.

Your host doesn’t allow .htaccess modifications

Some managed hosting environments lock the .htaccess file and don’t allow plugins to modify it. In this case, BerqWP’s rules won’t be written, and server-side delivery won’t work.

If you suspect this is the issue, contact your hosting provider and ask whether plugins are allowed to write to .htaccess. If they are not, BerqWP will still serve cached pages via PHP (slightly slower, but still faster than an uncached request).

Another cache plugin is interfering

If you have another caching plugin installed (WP Rocket, W3 Total Cache, LiteSpeed Cache, etc.), its .htaccess rules may conflict with BerqWP’s. Deactivate any other cache plugins before using BerqWP.


If you’re still having trouble, reach out at berqwp.com/support or email support@berqwp.com.

Offload Performance Headache to BerqWP

No configurations
Built for non techies
100% risk free
BerqWP v4 Dashboard