/**
* 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;
}
/**
* 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);
}
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".
Comments
Comment #1
bt82 commentedi would be interested in this feature.
Comment #2
delykj commented+1
Reference:
http://code.google.com/p/page-speed/wiki/MinifyHtml
http://stackoverflow.com/questions/728260/html-minification
Comment #3
Andrey Zakharov commentedSubscribe
Comment #4
Ela commentedsubscribing
Comment #5
momper commentedsub
Comment #6
broncomania commentedsubscribing
Comment #7
granttoth commented+1
Comment #8
myared commentedsubscribe
Comment #9
mikeytown2 commentedHook is already in place
Comment #10
marios88 commented+1
Comment #11
TNmoxa commentedsubscribing
Comment #12
willeifler commentedsubscribing
Comment #13
marios88 commentedhow about using htmlpurifier module?
http://drupal.org/project/htmlpurifier
http://htmlpurifier.org/
Does anyone have experience using this?
Comment #14
mikeytown2 commentedThis should do it
Comment #15
marios88 commentedJust noticed
in /admin/settings/performance/boost
Using "_htmlpurifier_process($data, 1);" as you proposed
Would this have the desired effect?
Comment #16
mstrelan commentedThis hook no longer exists in 7.x, is there a reason for that?
Comment #17
adamgerthel commentedLooking for this as well. Anyone have any idea how to best implement it? Either through Boost or before Boost.
Comment #18
damic commentedYou can try this:
http://iconsulting-fr.com/contribs/drupal-7-minify-html-output
Comment #19
tfranz commentedThe Drupal Module "Minify" has an option to minify the html-output bevor it is delivered to Boost:
https://www.drupal.org/project/minify
Comment #20
c-logemannI 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".