WordPress.org

Ready to get started?Download WordPress

Forums

W3 Total Cache
page cache disk enhanced - Â characters appear (44 posts)

  1. Nic Windley
    Member
    Posted 1 year ago #

    If I enable the page "Disk: Enhanced" option in W3 Total Cache I start seeing  characters appear on the front page.

    If I use "Disk: Basic" for page cache the problem goes away.

    Any idea why this caching mode is causing these encoded characters to appear and how I would resolve it ?

    Thanks,

    Nic

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

  2. Nic Windley
    Member
    Posted 1 year ago #

    Interestingly the first time it builds the page its seems fine, however subsequent requests (probably when it grabs the cache file) is when the encoded characers start appearing ?

    There are no characters in the database / content so this is being caused by the enhanced page cache.

  3. Nic Windley
    Member
    Posted 1 year ago #

    The difference in page load times is around 100% - i.e. using basic its taking 4 to 6 seconds and using enhanced 2 to 3 seconds.

  4. Nic Windley
    Member
    Posted 1 year ago #

    It only ever seens to occur on the front page ?

  5. robnalexpress
    Member
    Posted 1 year ago #

    I'm seeing this behavior also, but not just on the front page.

  6. Nic Windley
    Member
    Posted 1 year ago #

    Hmm, I've tried this on another site and I'm seeing this across all sorts of pages. Is this some kind of file encoding / header problems or white space in php files ?

  7. Keating
    Member
    Posted 1 year ago #

    Same problem. Disable Page Cache in W3TC fixed it, even if downgrading to 0.9.2.5 it was still broken after upgrading WP to 3.5.1.

  8. robnalexpress
    Member
    Posted 1 year ago #

    For me, this issue occurs when page cache is set to Disk: Enhanced. Changing the setting to Disk: Basic eliminates the issue for me.

  9. Nic Windley
    Member
    Posted 1 year ago #

    When Disk: Enhanced mode is enabled files are stored in a seperate folder (wp-content/cache/page_enhanced) with the following htaccess directives to apply additional encoding.

    # BEGIN W3TC Page Cache cache
    FileETag MTime Size
    <IfModule mod_mime.c>
    AddType text/html .html_gzip
    AddEncoding gzip .html_gzip
    AddType text/xml .xml_gzip
    AddEncoding gzip .xml_gzip
    </IfModule>
    <IfModule mod_deflate.c>
    SetEnvIfNoCase Request_URI \.html_gzip$ no-gzip
    SetEnvIfNoCase Request_URI \.xml_gzip$ no-gzip
    </IfModule>
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType text/html M7200
    </IfModule>
    <IfModule mod_headers.c>
    Header set X-Powered-By "W3 Total Cache/0.9.2.8"
    Header set Vary "Accept-Encoding, Cookie"
    Header set Pragma "public"
    Header append Cache-Control "public, must-revalidate, proxy-revalidate"
    </IfModule>
    # END W3TC Page Cache cache

    I'm guessing that its an encoding problem caused by content being compressed more then once possibly, so I'm going to have a chat with my host to see what they say.

    BTW I'm running Litespeed, anybody else or you running Apache ?

  10. Nic Windley
    Member
    Posted 1 year ago #

    If you're on Litespeed I did find this.

    http://www.litespeedtech.com/support/forum/archive/index.php/t-5577.html

    So I'm doing a little more digging.

  11. Nic Windley
    Member
    Posted 1 year ago #

    I've started this thread in the Litespeed forum (see link below) which may help others and I have a paid ticket open with my host to optimise the environment.

    http://www.litespeedtech.com/support/forum/showthread.php?t=6653

  12. Keating
    Member
    Posted 1 year ago #

    nisiwi, I was on litespeed yes. Then I changed to nginx and it just had another error in W3TC so I am just waiting for Frederick to fix it.

  13. Keating
    Member
    Posted 1 year ago #

    BTW, I have found nginx to be much faster versus litespeed in my tests. site loads in about 1.9s now. just worth mentioning as litespeed isnt cheap.

  14. Nic Windley
    Member
    Posted 1 year ago #

    Thanks Keating thats interesting. From what most people say its a configuration issue in terms of delivering performance with each environment. However if the cost doesn't offer an edge....why pay for it.

    There are lots of conflicting tests and comparisons on all this so for now I'm sticking with Litespeed and maybe I'll give nginx a try once I've got this resolved / stable so that I can compare results.

    As you're on a different environments it can't be a Litespeed issue so much be a problem with the htaccess encoding rules somewhere in general.

  15. Keating
    Member
    Posted 1 year ago #

    nisiwi, it could be a litespeed issue. to clarify, as I'm on nginx now - I don't see those weird characters any more. It's just that enabling Page Cache Enhanced on nginx throws an error inside W3TC and won't let me continue, it just defaults back to Page Cache Basic.

    Note that I tried downgrading to 9.2.5 but the same issue occurs, it started when I upgraded to WP 3.5.1 so that's the probable cause, something to do with the new filesystem.

  16. Nic Windley
    Member
    Posted 1 year ago #

    Ok, understood.

  17. Nic Windley
    Member
    Posted 1 year ago #

    The fix was simple and it was a character encoding problem.

    Just add

    AddDefaultCharset utf-8

    to your htaccess file in the wp-content/cache/page_enhanced folder and voila problem resolved!

    I hope Frederick adds this to future releases.

  18. Keating
    Member
    Posted 1 year ago #

    I don't have that folder :(

  19. Nic Windley
    Member
    Posted 1 year ago #

    If you have Disk: Enhanced then that folder gets created bt W3TC. Otherwise if its not enabled you probably won't have that folder.

  20. robnalexpress
    Member
    Posted 1 year ago #

    @nisiwi-

    Your solution to add
    AddDefaultCharset utf-8

    to the htaccess file in the wp-content/cache/page_enhanced folder seems to have worked for firefox and safari, but not chrome, even after clearing the browser cache.

    Rob

  21. Nic Windley
    Member
    Posted 1 year ago #

    It works in all browsers as its a standard characterset robnalexpress, not browser specific. Make sure you clear the cache in Chrome using Clear browsing data - Empty the cache and then reload the page while holding shown Shift key to ensure it forces a new page build.

  22. robnalexpress
    Member
    Posted 1 year ago #

    @nisiwi- I revisited the site after a couple hours, and getting your post, and it's now fine in chrome.

    Thanks so much for posting this solution- it's great to have Disk Enhanced page caching working again. I'll implement your fix on my other sites tomorrow!

    Rob

  23. robnalexpress
    Member
    Posted 1 year ago #

    @nisiwi-

    I just tried this fix on another site, and again I can't see the results in chrome! Tried clearing the cache as you suggested, using Clear browsing data - Empty the cache and then reload the page while holding shown Shift key, and no joy- still seeing the funky characters.

    Rob

  24. Nic Windley
    Member
    Posted 1 year ago #

    what about other caches like cloudflare ?

  25. robnalexpress
    Member
    Posted 1 year ago #

    I don't use cloudflare. This is really bugging me! Pages are displaying fine on every other browser, including chrome on my notebook. I even did a ipconfig/flushdns from CMD prompt. Insane- it's gotta be a chrome issue.

    Rob

  26. Nic Windley
    Member
    Posted 1 year ago #

    not if its working on your notebook with Chrome

    have you cleared cookies also ? if not try that (a complete clean) as I've found sometimes a corrupt cookie can cause problems

  27. robnalexpress
    Member
    Posted 1 year ago #

    Clearing the cookies fixed it! Who would have thunk it?! Thanks, again, Nic!

  28. robnalexpress
    Member
    Posted 1 year ago #

    Note to other users of the above fix:

    If you empty your W3TC page cache after adding "AddDefaultCharset utf-8" to the htaccess file in the wp-content/cache/page_enhanced folder, you may get a W3TC warning that new rules need to be written to the file. If you click auto-install, it will overwrite the change and you'll be back to square one, so just click "hide this message" and ignore it.

    Rob

  29. robnalexpress
    Member
    Posted 1 year ago #

    FWIW, I just upgraded 3 other sites to version, 0.9.2.8, fully expecting to have to use the above fix, however my sites that have a static front page do not have this issue- it's only on the sites that have a blog index on the front page.

    UPDATE: Posted too soon- I'm seeing it on the other sites now too.

    Rob

  30. Mike McKoy
    Member
    Posted 11 months ago #

    I have this problem too and the UTF-8 code is already in the htacess. When I clear the cache the page appears fine and on the next load it is all characters. The problem has to be related to something else. Compression is turned completely off. I have switched to basic mode.

    # BEGIN W3TC Page Cache cache
    AddDefaultCharset utf-8
    Options -MultiViews
    <Files ~ "\.(html|html_gzip|xml|xml_gzip)$">
      Allow from all
    </Files>
    AddDefaultCharset UTF-8
    FileETag MTime Size
    <IfModule mod_expires.c>
        ExpiresActive On
        ExpiresByType text/html M604800
    </IfModule>
    <IfModule mod_headers.c>
        Header set X-Pingback "http://rashaentertainment.com/xmlrpc.php"
        Header set X-Powered-By "W3 Total Cache/0.9.2.9"
        Header set Vary "Cookie"
        Header set Pragma "public"
        Header append Cache-Control "public"
    </IfModule>
    # END W3TC Page Cache cache

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic