2017 © Pedro Peláez
 

library minify

Minify is a PHP5 app that helps you follow several rules for client-side performance. It combines multiple CSS or Javascript files, removes unnecessary whitespace and comments, and serves them with gzip encoding and optimal client-side cache headers

image

mrclay/minify

Minify is a PHP5 app that helps you follow several rules for client-side performance. It combines multiple CSS or Javascript files, removes unnecessary whitespace and comments, and serves them with gzip encoding and optimal client-side cache headers

  • Friday, January 5, 2018
  • by mrclay
  • Repository
  • 158 Watchers
  • 2512 Stars
  • 2,098,139 Installations
  • PHP
  • 125 Dependents
  • 3 Suggesters
  • 430 Forks
  • 41 Open issues
  • 15 Versions
  • 6 % Grown

The README.md

Welcome to Minify!

Minify is an HTTP server for JS and CSS assets. It compresses and combines files and serves it with appropriate headers, allowing conditional GET or long-Expires., (*1)

Before 7 requests
After 2 requests

The stats above are from a brief walkthrough which shows how easy it is to set up Minify on an existing site. It eliminated 5 HTTP requests and reduced JS/CSS bandwidth by 70%., (*2)

Relative URLs in CSS files are rewritten to compensate for being served from a different directory., (*3)

Static file serving

Version 3 allows serving files directly from the filesystem for much better performance. We encourage you to try this feature., (*4)

Support

Post to the Google Group., (*5)

Installation

See the install guide., (*6)

Configuration & Usage

(Using 2.x? Here are the 2.x docs.), (*7)

See the user guide., (*8)

Minify also comes with a URI Builder application that can help you write URLs for use with Minify or configure groups of files., (*9)

See the cookbook for more advanced options for minification., (*10)

More docs are available., (*11)

Unit Testing

  1. Install dev deps via Composer: composer install
  2. composer test or phpunit

Warnings

  • Minify is designed for efficiency, but, for very high traffic sites, it will probably serve files slower than your HTTPd due to the CGI overhead of PHP. See the FAQ and CookBook for more info.
  • If you combine a lot of CSS, watch out for IE's 4096 selectors-per-file limit, affects IE 6 through 9.
  • Minify should work fine with files encoded in UTF-8 or other 8-bit encodings like ISO 8859/Windows-1252. By default Minify appends ";charset=utf-8" to the Content-Type headers it sends.

Acknowledgments

Minify was inspired by jscsscomp by Maxim Martynyuk and by the article Supercharged JavaScript by Patrick Hunlock., (*12)

The JSMin library used for JavaScript minification was originally written by Douglas Crockford and was ported to PHP by Ryan Grove specifically for use in Minify., (*13)

The Versions

05/01 2018

dev-master

9999999-dev https://github.com/mrclay/minify

Minify is a PHP5 app that helps you follow several rules for client-side performance. It combines multiple CSS or Javascript files, removes unnecessary whitespace and comments, and serves them with gzip encoding and optimal client-side cache headers

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Stephen Clay

03/11 2017

2.x-dev

2.9999999.9999999.9999999-dev http://code.google.com/p/minify/

Minify is a PHP5 app that helps you follow several rules for client-side performance. It combines multiple CSS or Javascript files, removes unnecessary whitespace and comments, and serves them with gzip encoding and optimal client-side cache headers

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.2.1
  • ext-pcre *

 

The Development Requires

by Stephen Clay

03/11 2017

2.3.3

2.3.3.0 http://code.google.com/p/minify/

Minify is a PHP5 app that helps you follow several rules for client-side performance. It combines multiple CSS or Javascript files, removes unnecessary whitespace and comments, and serves them with gzip encoding and optimal client-side cache headers

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.2.1
  • ext-pcre *

 

The Development Requires

by Stephen Clay

03/11 2017

3.0.3

3.0.3.0 https://github.com/mrclay/minify

Minify is a PHP5 app that helps you follow several rules for client-side performance. It combines multiple CSS or Javascript files, removes unnecessary whitespace and comments, and serves them with gzip encoding and optimal client-side cache headers

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Stephen Clay

15/09 2017

3.0.2

3.0.2.0 https://github.com/mrclay/minify

Minify is a PHP5 app that helps you follow several rules for client-side performance. It combines multiple CSS or Javascript files, removes unnecessary whitespace and comments, and serves them with gzip encoding and optimal client-side cache headers

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Stephen Clay

08/06 2017

3.0.1

3.0.1.0 https://github.com/mrclay/minify

Minify is a PHP5 app that helps you follow several rules for client-side performance. It combines multiple CSS or Javascript files, removes unnecessary whitespace and comments, and serves them with gzip encoding and optimal client-side cache headers

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Stephen Clay

08/06 2017

2.3.2

2.3.2.0 http://code.google.com/p/minify/

Minify is a PHP5 app that helps you follow several rules for client-side performance. It combines multiple CSS or Javascript files, removes unnecessary whitespace and comments, and serves them with gzip encoding and optimal client-side cache headers

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.2.1
  • ext-pcre *

 

The Development Requires

by Stephen Clay

03/04 2017

3.0.0

3.0.0.0 https://github.com/mrclay/minify

Minify is a PHP5 app that helps you follow several rules for client-side performance. It combines multiple CSS or Javascript files, removes unnecessary whitespace and comments, and serves them with gzip encoding and optimal client-side cache headers

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Stephen Clay

03/04 2017

2.3.1

2.3.1.0 http://code.google.com/p/minify/

Minify is a PHP5 app that helps you follow several rules for client-side performance. It combines multiple CSS or Javascript files, removes unnecessary whitespace and comments, and serves them with gzip encoding and optimal client-side cache headers

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.2.1
  • ext-pcre *

 

The Development Requires

by Stephen Clay

08/03 2016

2.3.0

2.3.0.0 http://code.google.com/p/minify/

Minify is a PHP5 app that helps you follow several rules for client-side performance. It combines multiple CSS or Javascript files, removes unnecessary whitespace and comments, and serves them with gzip encoding and optimal client-side cache headers

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.2.1
  • ext-pcre *

 

The Development Requires

by Stephen Clay

30/10 2014

2.2.1

2.2.1.0 http://code.google.com/p/minify/

Minify is a PHP5 app that helps you follow several rules for client-side performance. It combines multiple CSS or Javascript files, removes unnecessary whitespace and comments, and serves them with gzip encoding and optimal client-side cache headers

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.2.1
  • ext-pcre *

 

The Development Requires

by Stephen Clay

18/09 2014

dev-bubble_filter_idea

dev-bubble_filter_idea http://code.google.com/p/minify/

Minify is a PHP5 app that helps you follow several rules for client-side performance. It combines multiple CSS or Javascript files, removes unnecessary whitespace and comments, and serves them with gzip encoding and optimal client-side cache headers

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.2.1
  • ext-pcre *

 

by Stephen Clay

12/03 2014

2.2.0

2.2.0.0 http://code.google.com/p/minify/

Minify is a PHP5 app that helps you follow several rules for client-side performance. It combines multiple CSS or Javascript files, removes unnecessary whitespace and comments, and serves them with gzip encoding and optimal client-side cache headers

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.2.1
  • ext-pcre *

 

23/07 2013

2.1.7

2.1.7.0 http://code.google.com/p/minify/

Minify is a PHP5 app that helps you follow several rules for client-side performance. It combines multiple CSS or Javascript files, removes unnecessary whitespace and comments, and serves them with gzip encoding and optimal client-side cache headers

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.2.1
  • ext-pcre *

 

20/07 2013

2.1.6

2.1.6.0 http://code.google.com/p/minify/

Minify is a PHP5 app that helps you follow several rules for client-side performance. It combines multiple CSS or Javascript files, removes unnecessary whitespace and comments, and serves them with gzip encoding and optimal client-side cache headers

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.2.1
  • ext-pcre *