What about Html minification for the generated pages?

Comments

bt82’s picture

i would be interested in this feature.

delykj’s picture

Andrey Zakharov’s picture

Subscribe

Ela’s picture

subscribing

momper’s picture

sub

broncomania’s picture

subscribing

granttoth’s picture

+1

myared’s picture

subscribe

mikeytown2’s picture

Hook is already in place

/**
 * Edit document before it is put into the boost cache.
 *
 * This hook is run at right before the page is cached by boost.
 *
 * $GLOBALS['_boost_cache_this'] and $GLOBALS['_boost_router_item'] are useful.
 * set $GLOBALS['_boost_cache_this'] = FALSE if you wish to not cache this page.
 *
 * @param $path
 *   URL path of the document
 * @param $data
 *   String containing the data
 * @param $extension
 *   file extension type. Use to detect what type of document your operating on.
 * @return
 *   $data string containing the document
 */
function hook_boost_preprocess($path, $data, $extension) {
  return $data;
}
marios88’s picture

+1

TNmoxa’s picture

subscribing

willeifler’s picture

subscribing

marios88’s picture

how about using htmlpurifier module?

http://drupal.org/project/htmlpurifier

http://htmlpurifier.org/

Does anyone have experience using this?

mikeytown2’s picture

This should do it

/**
* Implement hook_boost_preprocess
*
* @param $path
*   URL path of the document
* @param $data
*   String containing the data
* @param $extension
*   file extension type. Use to detect what type of document your operating on.
* @return
*   $data string containing the document
*/
function my_module_boost_preprocess($path, $data, $extension) {
  return _htmlpurifier_process($data, 1);
}

marios88’s picture

Just noticed

Boost advanced settings
Pre-process function: 

in /admin/settings/performance/boost

Using "_htmlpurifier_process($data, 1);" as you proposed

Would this have the desired effect?

mstrelan’s picture

This hook no longer exists in 7.x, is there a reason for that?

AdamGerthel’s picture

Looking for this as well. Anyone have any idea how to best implement it? Either through Boost or before Boost.

damic’s picture

tfranz’s picture

Issue summary: View changes

The Drupal Module "Minify" has an option to minify the html-output bevor it is delivered to Boost:
https://www.drupal.org/project/minify

C-Logemann’s picture

Status: Active » Closed (won't fix)

I didn't checked this by myself but it seems the right way to organize "minify" in a way as suggested by @tfranz outside of the boost module. On the other side I'm following a strategy for Drupal 8 version to make boost a more lean module. So I colose this feature request as "won't fix".