Support » Plugin: W3 Total Cache » Random blank pages or incorrectly formatted cached pages served

  • Resolved IntricatePixels


    WordPress 3.5.1
    W3 Total Cache Plugin
    Only Page Cache, Disk Enhanced is enabled.

    I’m getting blank pages randomly on my site. Purging the blank page from cache fixes the issue temporarily. After reading this post, I was able to replicate the blank pages by typing in a url with no trailing slash at the end, like so: Not having a forward slash at the end causes the caching plugin to cache a blank (0 bytes) page. Nothing is on that page, even when I view the source code.

    Any ideas to what could be causing this?

    Some details about our current set up that might help determine the root cause of the issue:

    WordPress is running on Windows Azure Cloud, PHP 5.3, IIS and MySQL, and distributed in two servers. As of right now the cache is created on both servers.

Viewing 1 replies (of 1 total)
  • For anyone else running into this same issue, to fix the problem with W3 Total Cache caching blank pages, I added a url rewrite rule to our server config so that it always add a trailing slash to directories. So, if you type you’re (301) redirected to (note trailing slash at the end). This is performed before W3 Total Cache caches the page.

    Depending on your server configuration, you want to do this in your htaccess file (apache) or your web.config using a rewrite rule (IIS). In IIS you need to have the URL Rewrite Module installed in order to use rewrite rules.

    This is what my IIS rewrite rule looks like in web.config (make sure this comes before any wordpress rewrite rules):

    <rule name="Add trailing slash" stopProcessing="true">
      <match url="(.*[^/])$" />
        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
        <add input="{REQUEST_FILENAME}" pattern="(.*?)\.html$" negate="true" />
        <add input="{REQUEST_FILENAME}" pattern="(.*?)\.aspx$" negate="true" />
      <action type="Redirect" redirectType="Permanent" url="{R:1}/" />

    My other issue related to incorrectly formatted cached pages is related to another issue with the Ubermenu plugin and W3 Total Cache.

Viewing 1 replies (of 1 total)
  • The topic ‘Random blank pages or incorrectly formatted cached pages served’ is closed to new replies.