flipzoom / ProcessWire-AIOM-All-In-One-Minify

AIOM+ (All In One Minify) is a ProcessWire module to easily improve the performance of your website. By a simple function call Stylesheets, LESS and Javascript files can be parsed, minimized and combined into one single file. This reduces the server requests, loading time and minimizes the traffic. In addition, the generated HTML source code can be minimized and all generated files can be loaded over a cookieless domain (domain sharding).
MIT License
33 stars 26 forks source link

HTML minification RegEx causing stack overflow in Apache. #56

Open CaelanStewart opened 8 years ago

CaelanStewart commented 8 years ago

I was getting a connection reset error on every page load with no errors logged anywhere. It took me a while to locate the exact line, I had to keep moving an exit() call around until I found the offending piece of code.

Of course this can be solved by increasing the stack size, but so this plugin can be used in more limited environments, it might be worth not using a big regular expression, and instead opting for a different technique (seen here).

I modified AIOM to use this method, and it seems to do a better job of HTML minification as it also minifies inline styles and scripts. Though there are a couple of issues with it removing conditional comments, I think it's still worth looking into.