• Resolved apedog

    (@apedog)


    This is an intermittent issue I’ve been experiencing.
    Sometimes WP-Optimize cached pages will appear without proper encoding. Just a string of ??????? etc.

    Where should I look to configure this properly?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi there,

    Sorry for the delay. Could you share a link to your website?
    You can read this FAQ, where we share some of the reasons that could provoque this to happen.

    Marc.

    Thread Starter apedog

    (@apedog)

    Thank you for that link.
    I believe there is a flush() command in one of my themes’ header.php file.
    I’ll look into that now.

    Perhaps add that link to the main FAQ on this plugin’s WP.org page. I would not have found that link independently. And it seems like an easy fix.

    Also, perhaps add “UTF8” to the post’s title somehow – to aid with Google searches on the topic.

    Do you get only ??????? caracters, or a bunch of different ones?
    The issue usually comes from the fact that the content is compressed using GZIP, and is either truncated or modified. So not UTF8 related. But if you see some normal text and ???????s, then it might be different.

    Perhaps add that link to the main FAQ on this plugin’s WP.org page. I would not have found that link independently. And it seems like an easy fix.

    Also, perhaps add “UTF8” to the post’s title somehow – to aid with Google searches on the topic.

    Thanks for the suggestions.

    • This reply was modified 4 years, 8 months ago by Marc Lacroix.
    Thread Starter apedog

    (@apedog)

    Like I said, it’s intermittent. So I can’t reproduce the problem.
    But IIRC it’s mainly ?????? and whitespaces. There was no discernable text in there.
    And it only appears on the “first” call to a non-cached page. Reloading the page fixes the problem. So I understand that it’s GZIP related, and flush() truncating the content.

    I never fully wrapped my head around the technical lingo surrounding character encoding.
    In my mind (and therefore in my searches) whenever I see ? REPLACEMENT CHARACTER it’s always a UTF8 related search. https://en.wikipedia.org/wiki/Specials_(Unicode_block).

    I get how that’s not strictly correct. But I would never have searched for “garbage characters”. I’d search for “strange characters” or “weird characters” or “utf8 special characters” etc.

    Hi,

    Did you manage to fix the issue by tweaking your theme?
    Something else which could cause the issue is if an other plugin is compressing the content before WP-Optimize. For example the plugin “Far future expiration” has a GZIP feature that conflicts with WP-Optimize: the page is compressed twice instead of just once.

    You can search your files for ob_gzhandler and gzencode to see if one of the plugins does this.

    Marc.

    Thread Starter apedog

    (@apedog)

    Thanks for the followup.
    I’m pretty certain at this point the problem was the flush() call in the theme running before the <body> tag.

    I am trying out WP-Optimize with a custom plugin that minifies HTML (and hopefully also inline js+css). Some of the minifier libraries I tested do have calls to gzencode – tho I can’t tell at this point if those calls were actually run during execution. Probably not. Specifically mrclay\Minify. The current library I’m testing voku\HtmlMin does not do gzip at all (and has a nice API I can use to add compressors for inline js and css).

    On an unrelated note, I did have a horrible experience when switching between WP Super Cache and WP-Optimize. WP Super Cache would critical-error crash my installation if I had turned on WP-Optimize even if the caching option on WPO was disabled (but if the caching option on WSC was left on when previously disabling WSC plugin). On re-enabling WSC plugin through the plugins page – the entire site would crash.

    The other way around – enabling WPO when WSC was already enabled did not crash. There was just a message about the advanced-cache.php file conflict IIRC. Which is one of the reasons I’m going with WP-Optimize ??

    Thanks for pointing out your experience when switching between WSC and WP-Optimize. I’ll check if there’s anything we should do on our side.

    I’ll mark this as resolved, but feel free to keep commenting or opening new threads if you encounter anymore issue.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Special utf8 characters appearing when using WP-Optimize Cache’ is closed to new replies.