• Stars
    star
    3,006
  • Rank 15,023 (Top 0.3 %)
  • Language
    PHP
  • License
    BSD 3-Clause "New...
  • Created over 13 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Combines. minifies, and serves CSS or Javascript files

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.

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%.

Relative URLs in CSS files are rewritten to compensate for being served from a different directory.

Static file serving

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

Support

Post to the Google Group.

Installation

See the install guide.

Configuration & Usage

(Using 2.x? Here are the 2.x docs.)

See the user guide.

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

See the cookbook for more advanced options for minification.

More docs are available.

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.

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.

More Repositories

1

jsmin-php

Provides a modified port of Douglas Crockford's jsmin.c, which removes unnecessary whitespace from JavaScript files.
PHP
49
star
2

Props

An IDE and static analysis friendly PHP DI container
PHP
35
star
3

shibalike

Shibalike is a PHP library for creating Single Sign On between PHP apps on the same origin by emulating a Shibboleth environment. It has components to query attributes for a user, persist them in a non-native Session implementation, and inject them into the $_SERVER array as would a Shibboleth web server module.
PHP
19
star
4

piano-record

TypeScript
12
star
5

Elgg-xcollection

(Deprecated) ElggCollection API
PHP
8
star
6

jSecureEdit

Java desktop encrypted text editor (crude proof-of-concept)
Java
7
star
7

xoxco_tags

Elgg plugin for nicer tags entry
JavaScript
7
star
8

old-misc

Old classes, components, functions, and other nonsense (formerly at Google code)
PHP
6
star
9

SecretMark

A mini web app to store encrypted text in a bookmark. The URL below is one host of this app, but run your own if it makes you feel safer.
PHP
6
star
10

LazyTreeReader

A PHP 5.3 library designed to lazily read nodes, and their relationships and attributes from a static hierarchical tree.
PHP
6
star
11

UserlandSession

Provides an HTTP cookie-based session component in plain PHP, allowing concurrent use with existing native sessions.
PHP
5
star
12

jsmin_minify

JSMin.php plus various enhancements from the Minify project
PHP
5
star
13

Elgg1.8-MyTheme

Sample starter theme for adding customizations to a fresh Elgg install
PHP
4
star
14

Elgg-ufcoe_access_defaults

PHP
4
star
15

Elgg-ufcoe_oembed

Elgg plugin to add client-side media embedding via simple links to video URLs
JavaScript
4
star
16

kj_elf_contribs

PHP
3
star
17

Elgg-shib_auth

Shibboleth auth adapter for Elgg
PHP
3
star
18

ScopedRole

A Contextual Role-Based Permissions Manager
PHP
3
star
19

Elgg-ufcoe_roles

Elgg plugin to provide a roles API
PHP
3
star
20

Elgg-ufcoe_tinymce

More complete configuration options for TinyMCE in Elgg
PHP
2
star
21

Elgg-elggx_lists_api

Ordered entity list API for Elgg
PHP
2
star
22

Elgg-mrclay_poll_svc

Polling Service API for Elgg
PHP
2
star
23

Elgg-mrclay_upgrade_key

Elgg plugin to prohibit anonymous visitors from executing /upgrade.php
PHP
2
star
24

Elgg-ufcoe_crumbs

Elgg: More user/group-centric breadcrumbs for Elgg 1.8
PHP
2
star
25

OC-ufcoe_shib_auth

Shibboleth authentication for ownCloud
PHP
2
star
26

Elgg-mrclay_combiner

Elgg 2.0 plugin to reduce HTTP requests
PHP
2
star
27

moodle-rubric-1.9

Updated Rubric patch for Moodle 1.9
PHP
2
star
28

Elgg-mrclay_aalborg

An extension of the Aalborg theme
PHP
2
star
29

encrypt-to-html

Encrypt messages/files as HTML files which can decrypt themselves
HTML
2
star
30

Elgg-quiet_deprecation

Elgg plugin to hide deprecation notices from admins (except for a whitelist of users)
PHP
2
star
31

elgg-url-sniffer

PHP class to analyze a URL to see if it's within an Elgg site, is an action/page, likely represents a GUID, etc.
PHP
2
star
32

Elgg-facebook_connect

Fork of Chetan Varshney's Facebook Connect Login for Elgg 1.8
PHP
2
star
33

WP_Shibboleth

temporary fork of WordPress Shibboleth plugin w/ Multisite fixes
PHP
1
star
34

git-bootcamp

A sample application to work on during our Git Bootcamp workshop
PHP
1
star
35

chore-wheel

JavaScript
1
star
36

elgg-docker-2

docker-compose project for testing Elgg 4
PHP
1
star
37

Elgg-ufcoe_customize_email

Add header/footer to e-mails sent by Elgg
PHP
1
star
38

Elgg-ufcoe_unit_control

Offers more control over Elgg's core unit test suite
PHP
1
star
39

EasterEgg

A mini app to embed a secret "easter egg" in a web page.
PHP
1
star
40

izap2videolist

Elgg: Convert iZap video objects to videolist objects
PHP
1
star
41

Elgg-mrclay_sso

Elgg plugin with an API for adding single sign on between PHP apps
PHP
1
star
42

Feedback

A JavaScript/PHP contact form that is docked in a tab on the left side of the screen and slides out when needed.
PHP
1
star