plyst / cakephp-minifyhtml-plugin Goto Github PK
View Code? Open in Web Editor NEWThis project forked from bdossantos/minify_html
CakePHP 2.x Minify HtmlHelper Plugin
This project forked from bdossantos/minify_html
CakePHP 2.x Minify HtmlHelper Plugin
Just for anyone that would actually use this:
On an average website - let's say 10k lines of html - the rendering rises dramatically from 5-10ms to over 150ms!
Do not use this plugin without being aware that the minifaction cost a magnitude of ressources more than just sending the non minified version.
It doesn't even minify everything, for example it has problems with embedded things like js code.
And instead of just whining, here a one liner that only has an impact of 60-80% and is actually doing better work:
return preg_replace(array('/ {2,}/', '/<!--.*?-->|\t|(?:\r?\n[ \t]*)+/s'), array(' ', ''), $html);
This may help people who see the minifier trying to get its hands on JSON responses. Throw this in your app controller's beforeRender()
// if the response is HTML then minify it
if ($this->response->type() === 'text/html') {
$this->helpers[] = 'MinifyHtml.MinifyHtml';
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.