• Resolved doblejou

    (@doblejou)


    Cache Enabler 1.7.0 does not create the cache-enabler directory under wp-content/cache and therefore does not work…..

    Thanks,

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter doblejou

    (@doblejou)

    Some important details:

    * Cache Enabler version 1.4.9 works perfectly for me.
    * Cache Enabler version 1.5.0 and higher does not work for me.

    Thread Starter doblejou

    (@doblejou)

    I see more clues:

    One of the conditions that CacheEnabler executes for whether or not to cache a page is this one that appears in the file cache_enabler_engine.class.php :

    $has_html5_doctype = preg_match( ‘/^<!DOCTYPE.+html>/i’, ltrim( $contents ) );

    which always gives FALSE, because the HTMl of my pages has UTF-8 BOM at the beginning \xef\xbb\xbf<!DOCTYPE , so $has_html5_doctype always gives FALSE and is not cached.

    What solution can you give me?

    Thanks

    Anonymous User 16850768

    (@anonymized-16850768)

    @doblejou, thanks for your effort in troubleshooting and identifying why this issue is occurring for you. To better understand your setup, is there a particular reason you’re using BOM before the HTML5 doctype?

    Thread Starter doblejou

    (@doblejou)

    Hello,

    Thank you Corey for replying. I don’t know. I imagine it’s some plugin or the theme that is inserting the BOM. Or maybe my Apache or PHP configuration.

    Anonymous User 16850768

    (@anonymized-16850768)

    You’re most welcome, @doblejou. In this case would it be possible for you to troubleshoot where you have this enabled and disable it? As far as I’m aware, using BOM is only for multibyte encoded data, which UTF-8 is not.

    Thread Starter doblejou

    (@doblejou)

    Hello,

    Yes, you are right that there is no point in using BOM. So far I have investigated and it is an issue for this site only, not for the others on the same server. So the BOM is introduced by a plugin or theme. I’m still investigating…… But in any case, wouldn’t it be better to check if the content includes the string “<!DOCTYPE html>” instead of if it starts exactly with it in position 0 ? It could be the case that the DOCTYPE starts on a second line or is preceded by spaces.

    Thanks,

    Anonymous User 16850768

    (@anonymized-16850768)

    Great, please let me know what you end up finding out.

    The contents from the output buffer first go through ltrim() before being searched so all whitespace characters are removed from the beginning of the string. In this case we do want to specifically check if that doctype is declared at the beginning and not anywhere in the contents.

    Thread Starter doblejou

    (@doblejou)

    I have already discovered the problem.The functions.php file of the child theme had BOM probably added by the text editor used to edit it. It would be interesting that Cache-Enabler somehow warns that the content includes BOM and therefore will not be cached or that even if it includes BOM it will cache it anyway.

    Thanks`Corey

    Anonymous User 16850768

    (@anonymized-16850768)

    Thanks for the update and the feedback provided. That’s very helpful.

    If you haven’t already and are able, leaving a review is always appreciated.

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Cache Enabler does not work’ is closed to new replies.