вот мой конфиг для htmlpurifier
$config = HTMLPurifier_Config::createDefault();
$config->set('Core.Encoding', 'utf-8');
$config->set('HTML.Doctype', 'XHTML 1.1');
//$config->set('HTML.AllowedAttributes', '*.data-src');
$config->set('AutoFormat.AutoParagraph', TRUE);
$config->set('AutoFormat.Linkify', TRUE);
$config->set('AutoFormat.RemoveEmpty', TRUE);
// хочу запретить кеширование ибо не зачем лишнюю папку открывать для записи
$config->set('Cache.DefinitionImpl', null);
flush() may not be able to override the buffering scheme of your web server and it has no effect on any client-side buffering in the browser. It also doesn't affect PHP's userspace output buffering mechanism. This means you will have to call both ob_flush()