Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Apparently a lot of people complain that they only see random letters and characters:

enter image description here

My biggest problem is that I can't reproduce the problem on ANY of my devices! Not on my Windows XP laptop, not on my Windows 7 laptop, not on my Android phone or my iPod Touch. It doesn't matter which browser I'm using. The only time I see the problem myself is when I try to share one of my blog posts on Google+, because the blog description then appears in strange characters.

So, first of all I need to find a way to reproduce the problem somehow. Otherwise I won't be able to see if what I did fixed the problem or not.

I did everything that @toscho recommended, but nothing helped.

Did anybody ever run into a similar problem or would you know where I could start to look for the problem?

Edit: I contacted my webhost. They couldn't reproduce the problem, just like me. They said that they have enabled gzip compression on their servers. They suggested turning off one plugin after another to see what happens, but as I can't reproduce the problem, I can't do that. Please help!

More and more readers are complaining about this problem. Most of them just need to refresh the page or wait a few minutes and then the site loads normally, but I'm still using a lot of traffic because of that.

EDIT 2: The W3 Total Cache Plugin FAQ says: I see garbage characters instead of the normal web site, what's going on here?

If a theme or it's files use the call php_flush() or function flush() that will interfere with the plugins normal operation; making the plugin send cached files before essential operations have finished. The flush() call is no longer necessary and should be removed.

I am pretty sure that none of my code has this call anywhere, but I'm not 100% sure. Is there any way to find out other than searching through millions of characters in all of my files?

share|improve this question

put on hold as off-topic by Johannes Pille, G. M., Pieter Goosen, mrwweb, ialocin Aug 27 at 7:19

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Your question should be specific to WordPress. Generic PHP/JS/HTML/CSS questions might be better asked at Stack Overflow or another appropriate site of the Stack Exchange network. Third party plugins and themes are off topic." – Johannes Pille, G. M., Pieter Goosen, mrwweb, ialocin
If this question can be reworded to fit the rules in the help center, please edit the question.

    
Ignore the markup, that’s only relevant when the page is saved to the local file system or when the server doesn’t send the correct HTTP header. An URL to a page where this happens could help. –  toscho Jul 23 '12 at 5:36
    
@toscho Thank you very much. Sure: zoomingjapan.com –  japanworm Jul 23 '12 at 6:08
    
You send the content gzip encoded but the gzip file is invalid. Turn off gzip compression and add the details to your question about how you turned it on. –  toscho Jul 23 '12 at 6:14
1  
Hm, looks like it is gzip encoded twice. See this discussion for something similar. –  toscho Jul 23 '12 at 6:20
    
@toscho I use a plugin called "W3 Total Cache". Within this plugin I turned off the following option: "Enable HTTP (gzip) compression ". Could you see if the problem you mentioned still persists? Thank you. –  japanworm Jul 23 '12 at 6:34

3 Answers 3

up vote 6 down vote accepted

Let’s start with the output we got before the fix:

enter image description here

What happened here? My guess: a collision between the plugin W3 Total Cache and your web server LiteSpeed. I found a thread in a Drupal forum about a very similar (or the same) issue.

LiteSpeed seems not to send the appropriate HTTP headers for the compressed cache files W3TC stores. In its changelog for version 0.9.2.4 W3TC says:

Fixed LiteSpeed web server support

So the issue seems to be known, and an upgrade should fix it.

If the upgrade did not help …

  • Ask your web hoster. You pay for support, and nobody knows the internals better.
  • Or add …

    AddType application/x-gzip .gz .tgz
    AddEncoding x-gzip .gz .tgz
    

    … to your .htaccess to see if it helps.

  • Or turn gzip compression off in W3TC. That is the last option if all the other approaches fail.

To test the results, do not rely on browser output. All browsers use different workarounds for broken compression, you cannot work with that. Use a tool like GIDZipTest to see if everything is okay.

share|improve this answer
    
Thank you very much. My plugins are always up to date and I just checked. I'm already using the newest upgrade 0.9.2.4 - obviously that alone doesn't fix the problem. I take the other steps you suggested and will check with the tool you recommended. I hope I can fix the problem with that. Thank you! –  japanworm Jul 23 '12 at 6:58
    
Where would I put the code snippet in my .htaccess file to make it work? I just put it at the very end, but it didn't have any effect. Here's what my .htaccess file looks like right now: pastebin.com/j0qDqBUV –  japanworm Jul 23 '12 at 7:44
    
Should not matter. Try something else: Remove the line AddOutputFilterByType DEFLATE … –  toscho Jul 23 '12 at 7:46
    
I did. Thanks. I'm not sure if it fixed the problem. The DIDZipTest works, but in IE I still see strange letters. –  japanworm Jul 23 '12 at 7:59
    
Maybe a local caching issue in IE? After deleting the browser cache I got a working site. –  toscho Jul 23 '12 at 8:05

This happened to me because I had two plugins trying to GZip compress the output. Disabling the second plugin fixed the problem.

share|improve this answer

Always specify the encoding used for an HTML or XML page. If you don't, characters in your content may be incorrectly interpreted. Look inside your header file to specify English and UTF-8 settings. Here's whats in my header:

<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
share|improve this answer
    
Aliyah thank you! I thought I had it specified already (see my edited question for the code snippet), though it does call for some action, maybe it would be better to replace it with what you are using instead? I think I originally changed it because I also need to display Japanese characters as well as English and German. –  japanworm Jul 23 '12 at 2:45
    
And by the way, @toscho is the expert here. I have no idea what Im talking about lol. Not to the extent that Im sure tosho does. –  Aliyah Jul 23 '12 at 5:51
1  
@japanworm, I visited your site and I dont see anything weird going on there. Its very cute. :) –  Aliyah Jul 23 '12 at 5:56
    
Thank you! I checked again and saw that the snippet in my header has already been in my parent theme, but that doesn't mean it's without any faults. I hope "toscho" has a good idea. If not, I'll try what you suggested and see what happens. And thanks very much for the nice compliment! :) –  japanworm Jul 23 '12 at 6:07
    
@japan, we have a big problemo. I just went back to your site in 2 different browsers and all I see is a page full of funny characters. Your site doesnt even show up. Its not a browser issue. There must be some code messing up your site. Not sure if it has an effect or not but did you copy and paste my header into yours, replacing what yours had, all of it? In the meantime, Ill look into it and report back shortly –  Aliyah Jul 23 '12 at 6:30

Not the answer you're looking for? Browse other questions tagged or ask your own question.