WordPress.org

Ready to get started?Download WordPress

Forums

124

W3 Total Cache
Random Blank Pages - w3 total cache (103 posts)

  1. skrause
    Member
    Posted 1 year ago #

    Version 0.9.2.8

    My issue is very random and hard to repro and... I don't have a repro case yet.

    The problem I run into is since I enabled Disk Cache for Pages, Database and Objects, random pages are coming up blank and the only way to resolve is to clear cache. That that point, the page paints just fine.

    Like I said, once I clear the cache, the problem goes away however I don't have a good way of triggering it and only know about it when a user notifies me... ;)

    site -- groovypost.com

    Thanks,

    -S

    http://wordpress.org/extend/plugins/w3-total-cache/

  2. skrause
    Member
    Posted 1 year ago #

    More information.

    Looking through the file structure with my FTP client. The pages which show up blank look exactly the same at a file level however when you download the cached page via FTP -- it's empty.

    I delete the blank cache file then refresh the browser window and the page will always refresh without issue for me.

    So again, I have blank pages being created but I don't see a repro step yet on this.

    -S

  3. skrause
    Member
    Posted 1 year ago #

    Did more research and found root cause -- at least the reason this is happening....

    For whatever reason, if you try to open a page without a trailing slash / the blank page will be cached and then displayed to the visitor.

    I can repro this over and over....

    I still need to see if I can repro this on other sites as it might be a conflict between W3 Total Cache and another plugin I'm using...???

    For now, I'm using an .htaccess command to just add a trailing slash to everything.

    # Add trailing slash
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)([^/])$ /$1$2/ [L,R=301]

    Would be curious if you have any thoughts on this.

    -S

  4. z4reg
    Member
    Posted 1 year ago #

    Having similar issues with 0.9.2.8 and wp 3.5.1

    * Site working but no output thru minify (No Css / No Js)

    * Blank Admin Pages
    (To Get back admin rename object-cache.php , db.php and advanced-cache.php)

  5. z4reg
    Member
    Posted 1 year ago #

    After renaming /wp-content/w3tc-config/master.php and folloing instruction mentioned in http://wordpress.org/support/topic/w3tc-0928-killed-my-backend?replies=15

    1. Comment out line 127 in /wp-content/plugins/w3-total-cache/inc/functions/activation.php
    2. Your dashboard comes back - deactivate W3TC
    3. Remove the comments for line 127 so it is active again
    4. Activate W3TC and you are back in business

    Things working. You will have to configure W3TC again.

  6. skrause
    Member
    Posted 1 year ago #

    @z4reg -- not sure why you posted this information in this thread. Does not seem to be related to the specific issue I had listed in this thread.

  7. JoelDauteuil
    Member
    Posted 1 year ago #

    @skrause - I think we're having the exact same issue. It's been going on for about a month and we're tearing our hair out of here. Any traction yet?

    I was just about to try a manual uninstall of W3 and then a fresh install. Have you tried this yet? It seems W3 requires a clean install to eradicate some pesky issues similar to this. I've been doing some research but only your description hits the nail on the head. I saw similar issues - but not exact - around the time of the last release with folks who upgraded automagically.

  8. skrause
    Member
    Posted 1 year ago #

    What exact issue did you run into?

    @JoelDauteuil -- when you ran into this, did a full uninstall of W3 and re-install resolve the issue?

  9. JoelDauteuil
    Member
    Posted 1 year ago #

    "random pages are coming up blank and the only way to resolve is to clear cache"

    We see the same thing and a simultaneous CPU spike.

  10. JoelDauteuil
    Member
    Posted 1 year ago #

    @skrause: I have not done the full uninstall yet. Other things keep getting in the way.

  11. skrause
    Member
    Posted 1 year ago #

    Sounds like a very similar issue then.

  12. IntricatePixels
    Member
    Posted 1 year ago #

    Same issue here. Getting blank pages randomly. Like @skrause suggested here, clearing cache temporarily fixes the issue. Thanks to this post, I was able to trigger a blank page when trailing slash is missing.

    Moreover, I'm randomly getting "bad cached pages", where the header area of the served cached page is messed up (the full page content is there in this scenario). Similar to the blank page issue, to fix I clear the page cache. What's puzzling is that for this one I have no explanation or a way to repro. No idea what's causing it or if it's related to the blank page issue at all.

    Just curious, what environments is your WordPress running on, mind sharing some details?

    My site is running in Windows Azure, IIS, mysql, WP 3.5.1, in a multi-server env (distributed to two servers to be exact). Right now the W3TC plugin is creating cache in two locations. I wonder if this could be related to the issues I'm experiencing.

  13. IntricatePixels
    Member
    Posted 1 year ago #

    I was able to resolve the cached blank page issue by adding a rewrite rule (I'm on IIS, otherwise this would be done in htaccess if you're running on apache, see @skrause's reply above for htaccess code).

    Still curious to know why it's creating a blank page when trailing slash is missing, if anyone figures that out.

    For anyone looking, 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="(.*[^/])$" />
      <conditions>
        <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" />
      </conditions>
      <action type="Redirect" redirectType="Permanent" url="{R:1}/" />
    </rule>

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

  14. daethnir
    Member
    Posted 1 year ago #

    We ran into this as well. It's a bug in W3 Total Cache. I'm hoping the authors read this, else I'll try to get to them more directly.

    We had this occurring on our brand-new wordpress install too. Turns out that W3TC caches HEAD and GET and serves them equally. So if a HEAD request for a URL is sent, it will be cached, and the next time a GET for that same resource is received it will return the cached HEAD response, which means you'll get a "Content-Length: 2" and a \r\n for your content, nothing else.

    Here's a patch that will simply not cache HEAD at all:

    diff --git wp-content/plugins/w3-total-cache/lib/W3/PgCache.php wp-content/plugins/w3-total-cache/lib/W3/PgCache.php
    index aec6e61..44d0f61 100644
    --- wp-content/plugins/w3-total-cache/lib/W3/PgCache.php
    +++ wp-content/plugins/w3-total-cache/lib/W3/PgCache.php
    @@ -493,20 +493,26 @@ class W3_PgCache {
    
             /**
              * Skip if posting
              */
             if ($_SERVER['REQUEST_METHOD'] == 'POST') {
                 $this->cache_reject_reason = 'Requested method is POST';
    
                 return false;
             }
    
    +        if ($_SERVER['REQUEST_METHOD'] == 'HEAD') {
    +            $this->cache_reject_reason = 'Requested method is HEAD';
    +
    +            return false;
    +        }
    +
             /**
              * Skip if there is query in the request uri
              */
             if (!$this->_config->get_boolean('pgcache.cache.query') && strstr($this->_request_uri, '?') !== false) {
                 $this->cache_reject_reason = 'Requested URI contains query';
    
                 return false;
             }
    
             /**

    This is a large hammer that simply prevents any HEAD requests from being generated, so you never cache that 'blank' page. It does mean that you essentially have a heavy response generated each time for HEADs, so if caching is critical for your server load this is vulnerable to potential DoS.

    A better solution when a HEAD request is made would be to generate the page as if a GET were requested and cache both the HEAD and GET responses independently and serve the appropriate one. I have not investigated the W3 Total Cache code enough to implement this.

    I hope my change above, or the improved one I described, can make it into a updated version of the plugin. Please ping me if there are any questions.

    Here's how to reproduce this:

  15. Frederick Townes
    Member
    Plugin Author

    Posted 1 year ago #

    Managed to find this topic even though it was improperly tagged. This issue is fixed in the next release. Thank you.

  16. CrazySerb
    Member
    Posted 1 year ago #

    I've tried everything and anything suggested above and still got blank pages every so often, so it's definitely a bug of some sort in W3.

    When is the fix coming out?

  17. Frederick Townes
    Member
    Plugin Author

    Posted 1 year ago #

    @CrazySerb, Is there anything in your error log?

  18. CrazySerb
    Member
    Posted 1 year ago #

    nope.

    that would be a bit easier to troubleshoot, I know.

    I tried tweaking the settings for page cache (on its own tab), didn't help.

    I tried turning off page cache completely, leaving all the other caches 'memcached', didn't help.

    now I am considering turning off something else, but at this point what's the point, really - might as well uninstall the whole plugin.

  19. Frederick Townes
    Member
    Plugin Author

    Posted 1 year ago #

    @CrazySerb, even if other people on this topic appear to have a related issue, it's not a common one (saying that after supporting this plugin for 3 years), and for the same reason it's not easy to troubleshoot. If you would submit a bug submission form from the support tab of the plugin that would be a helpful next step.

  20. IntricatePixels
    Member
    Posted 1 year ago #

    @CrazySerb have you been able to narrow down to what triggers the blank page/s? That may help in identifying what's causing it. For some of us on this thread, blank pages were cached by the plugin when the forward slash was missing at the end of the url. If you have access to the cache files, start there. Also, look at the error logs.

  21. CrazySerb
    Member
    Posted 1 year ago #

    looked into the error logs, nothing specific there.

    added the / in permalinks in wp to get around that slash issue, no luck.

    started emptying out cache every 15 minutes... again, no luck, as things sometimes happen in between those cache cleanups.

    just weird...

    what would I look for in cache files?

  22. IntricatePixels
    Member
    Posted 1 year ago #

    Nothing specific in the cached files, but at least you can see the bad ones being created on the spot and delete them as needed, so good for manual testing.

    Are you on apache or IIS? Make sure you're adding the forward slash after all the other WP url rewrite.

  23. CrazySerb
    Member
    Posted 1 year ago #

    Apache.

    so add the / rewrite rule in addition to permalink update?

  24. IntricatePixels
    Member
    Posted 1 year ago #

    Yeah, give the rewrite rule a shot, hopefully that may do the trick.

  25. CrazySerb
    Member
    Posted 1 year ago #

    Nope, that didn't help either.

    Blank pages still keep being generated and served.

  26. skrause
    Member
    Posted 1 year ago #

    @Fredrick -- that's fantastic. Glad to hear you have a fix on the way.

    If you need any other information from me regarding let me know.

    Thanks,

    -S

  27. Frederick Townes
    Member
    Plugin Author

    Posted 1 year ago #

    It needs testing so if you want to submit a bug submission form from the support tab of the plugin I will get it out to you.

  28. skrause
    Member
    Posted 1 year ago #

    @Frederick -- yeah you bet. Will submit that over in 1-2 hours.

    Thnx again for jumping on this.

    -S

  29. nr56
    Member
    Posted 1 year ago #

    Just to clarify if I have the same problem - when you say "blank page" do you mean a white screen with one line of text at the top - which in my case is title of the post? Would like to know if this is the problem being resolved as I am facing it too. Thanks.

  30. CrazySerb
    Member
    Posted 1 year ago #

    I mean blank page with nothing on it...

124

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic