MinifyPageRender by thausmann

This module hooks into Page::render and compresses the frontend HTML.

MinifyPageRender

Simple HTML minifier for ProcessWire.

This module hooks after Page::render and runs a simple minification.

I mostly put this together for cosmetics. I like my View source neat and tidy.

This is not well tested yet, please open an issue if you run into problems.

Minification code


The minify function source code was taken from StackOverflow: https://stackoverflow.com/a/29363569/860205

Quote from the author:

This code removes redundant empty spaces. Also it plays it safe and does not remove anything that could potentially break HTML, JS or CSS.

Screenshot


Alt text

Changelog


1.0.1

  • Disabled one rule falsely removing whitespace in the character sequence ), something like (CEO), 2015

1.0.0

  • Initial release

Install and use modules at your own risk. Always have a site and database backup before installing new modules.

Latest news

  • ProcessWire Weekly #520
    In the 520th issue of ProcessWire Weekly we'll check out some of the latest additions to the ProcessWire module's directory, share some highlights from the latest weekly update from Ryan, and more. Read on!
    Weekly.pw / 27 April 2024
  • ProFields Table Field with Actions support
    This week we have some updates for the ProFields table field (FieldtypeTable). These updates are primarily focused on adding new tools for the editor to facilitate input and management of content in a table field.
    Blog / 12 April 2024
  • Subscribe to weekly ProcessWire news

“ProcessWire is like a breath of fresh air. So powerful yet simple to build with and customise, and web editors love it too.” —Margaret Chatwin, Web developer