W3TC Page Cache: Disk Enhanced causes encoding issue


Hello there!

After another day of playing with my new toy (easyengine) I found out that when using the prebuilt setup via ee create wp-site with w3tc and then configuring W3TC Page Cache option according to the provided tutorial here on rtCamp, it will generate the cache files with incompatible character encodings. This might only be visible in foreign languages, other than english.

The tutorial says, that we should set Page Cache to Disk: Enhanced. But this causes the incorrect output.

If I set it to Disk: Basic this faulty behaviour is gone. My desired charset is UTF8

And in my opinion, this should also be standard db charset for easy engine mysql setup… right after installing the wp tables for my site, they were all latin1 encoded. latin1 isn’t capable of german “umlaute” such as ä ö ü or special characters like ß or simply this: `.

In general the WordPress Codex recommend UTF8_general_ci collation because UTF8 charset supports most languages. Especially for sites using plugins like WPML with several language setups, this is a must.

Is there a special reason why the db is set up with latin1?

Also I was wondering why the ee table and dbs are all InnoDB engined. My old site’s db was MyISAM. When importing my sql dump, I had to manually convert mydomain_com db to the correct utf8 charset and utf8_general_ci collation and then convert it the tables to InnoDB, to achieve some kind of consistency.


I think there is something wrong with your old data.

I run more and less 2,000 WordPress sites in Portuguese, under EasyEngine, and it is the very first time someone complains of encoding issues.

Precisely, I use W3TC disk enhanced, on at least 90% of my blogs (some use WP Super Cache).


Actually there are others… please see this thread: https://wordpress.org/support/topic/w3-total-cache-cached-files-output-with-bizarre-encoding?replies=5

As I mentioned above, I fixed the issue, by converting the site’s db to utf8 charset and utf8_general_ci collation. Then converting the containing tables and then the columns of each table.

Unfortunately the default setting that MySQL comes with is latin1. Easyengine leaves it as it is.

Also this is not necessarily a problem caused by ee, but more a problem caused by W3tc. The above thread contains a link to another thread where people were discussing possible solutions to this issue.

Just because you haven’t heard of it, doesn’t mean it doesnt exist :smiley: