|
FAQ
Frequently asked questions.
How fast is it?With Minify you will ideally serve fewer requests, but Minify can be slower than your HTTPd serving flat files. If you have a high-traffic site with hundreds of simultaneous requests from new users, you should probably:
Will it get faster?Ideally, but a couple other goals come first. For Apache users we're designing a feature to enable minified and pre-encoded files to be served directly from the HTTPd. Requests will not execute PHP at all and be blazingly fast (for varying definitions of "blazingly"). How does it compare with other services?Yahoo's Combo Handler and Google's AJAX Libraries API both serve content from their heavy-duty CDNs and potentially increase the chance that your visitor will already have a file in her browser cache. Neither service serves custom content that you provide. You may wish to use these services to serve popular libraries and Minify to serve your code. Does it support gzip compression?Yes. Based on the browser's Accept-Encoding header, Minify will serve content encoded with deflate or gzip. Does it work with PHP opcode caches like APC and eAccelerator?Of course, and you can also use APC for content caching. Is there a minifier for HTML?Yes, and it can even minify embedded STYLE and SCRIPT elements. Since Minify_HTML is not fast, the best time to use it is when storing HTML; e.g., in a DB keep one copy for editing and one minified for serving. Minify is not suited for serving HTML pages on a site, though it can be done for small numbers of static pages. How does it ensure that the client can't request files it shouldn't have access to?In 2.1, by default, Minify allows files to be specified using the URI, or using pre-configured sets of files. With URI-specified files, Minify is very careful to serve only JS/CSS files that are already public on your server, but if you hide public directories--with .htaccess, e.g.--Minify can't know that. Obvious Tip: don't put sensitive info in JS/CSS files inside DOC_ROOT :) An included option can disable URI-specified files so Minify will serve only the pre-configured file sets. Is it used in production by any large-scale websites?I'd love to know. 2.1.1 had 54K downloads and I know the library is powering several plugins these days, at least 3 for WordPress. Can I use it with my commercial website or product?Yes. Minify is distributed under the New BSD License, which means that you're free to use, modify, and redistribute Minify or derivative works thereof, even for commercial purposes, as long as you comply with a few simple requirements. See the LICENSE.txt file for details. |
Sign in to add a comment
One more thing should appear in this FAQ : if some "minified" files aren't generated for some unknown reason, and if this happens when there are many files to minify, try increase your memory_limit to something like 64 or 128 Mb in your php.ini ...
Hi! Exponent CMS uses minify 1.x in it's 0.97 release series: http://www.exponentcms.org
I have recently integrated it into a fairly large scale vbulletin board, www.abadss.com, and is helping greatly.