{"id":13399857,"url":"https://github.com/mrclay/minify","last_synced_at":"2025-05-13T17:06:25.621Z","repository":{"id":444443,"uuid":"1951136","full_name":"mrclay/minify","owner":"mrclay","description":"Combines. minifies, and serves CSS or Javascript files","archived":false,"fork":false,"pushed_at":"2025-02-03T08:53:32.000Z","size":1789,"stargazers_count":3002,"open_issues_count":58,"forks_count":473,"subscribers_count":148,"default_branch":"master","last_synced_at":"2025-04-24T00:41:32.429Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrclay.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2011-06-25T05:52:15.000Z","updated_at":"2025-04-23T12:08:27.000Z","dependencies_parsed_at":"2024-06-18T10:38:05.753Z","dependency_job_id":"7ba98eda-21fb-45c8-af24-f17eef33f5c3","html_url":"https://github.com/mrclay/minify","commit_stats":{"total_commits":664,"total_committers":46,"mean_commits":"14.434782608695652","dds":"0.44728915662650603","last_synced_commit":"23f055d3f58b4e8c94b23abeace612f3040a3816"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrclay%2Fminify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrclay%2Fminify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrclay%2Fminify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrclay%2Fminify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrclay","download_url":"https://codeload.github.com/mrclay/minify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253990466,"owners_count":21995774,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T19:00:44.117Z","updated_at":"2025-05-13T17:06:25.538Z","avatar_url":"https://github.com/mrclay.png","language":"PHP","funding_links":[],"categories":["PHP","类库"],"sub_categories":["前端相关"],"readme":"## Minify is no longer regularly maintained\n\nThe original authors no longer recommend using Minify, especially previous versions, which were not designed to handle modern JS and CSS syntax. Instead, use an up-to-date performance measurement tool like [Lighthouse](https://developer.chrome.com/docs/lighthouse/overview) and follow its recommendations.\n\nIn 2010, Minify offered a fine improvement for some websites, but browsers and HTTP servers are now much better, and Minify may offer only a marginal performance benefit in narrow cases. Also both JS and CSS now change rapidly, and new syntaxes are likely to lead to broken code being served through Minify.\n\n## About\n\nMinify is an HTTP server for JS and CSS assets. It compresses and combines files\nand serves it with appropriate headers, allowing conditional GET or long-Expires.\n\n| *Before* | ![7 requests](http://mrclay.org/wp-content/uploads/2008/09/fiddler_before.png) |\n|----------|-----------------------------------------------------------------|\n| *After*  | ![2 requests](http://mrclay.org/wp-content/uploads/2008/09/fiddler_after.png)  |\n\nThe stats above are from a [brief walkthrough](http://mrclay.org/index.php/2008/09/19/minify-21-on-mrclayorg/) 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%.\n\nRelative URLs in CSS files are rewritten to compensate for being served from a different directory.\n\n## Static file serving\n\nVersion 3 allows [serving files directly from the filesystem](static/README.md) for much better performance. We encourage you to try this feature.\n\n## Support\n\nPost to the [Google Group](http://groups.google.com/group/minify).\n\n## Installation\n\nSee the [install guide](docs/Install.wiki.md).\n\n## Configuration \u0026 Usage\n\n(Using 2.x? [Here are the 2.x docs](https://github.com/mrclay/minify/tree/2.x/docs).)\n\nSee the [user guide](docs/UserGuide.wiki.md).\n\nMinify also comes with a [URI Builder application](docs/BuilderApp.wiki.md) that can help you write URLs\nfor use with Minify or configure groups of files.\n\nSee the [cookbook](docs/CookBook.wiki.md) for more advanced options for minification.\n\nMore [docs are available](docs).\n\n## Unit Testing\n\n1. Install dev deps via Composer: `composer install`\n1. `composer test` or `phpunit`\n\n## Warnings\n\n* 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](docs/FAQ.wiki.md#how-fast-is-it) and [CookBook](docs/CookBook.wiki.md) for more info.\n* If you combine a lot of CSS, watch out for [IE's 4096 selectors-per-file limit](http://stackoverflow.com/a/9906889/3779), affects IE 6 through 9.\n* 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.\n\n## Acknowledgments\n\nMinify was inspired by [jscsscomp](http://code.google.com/p/jscsscomp/) by Maxim Martynyuk and by the article [Supercharged JavaScript](http://www.hunlock.com/blogs/Supercharged_Javascript) by Patrick Hunlock.\n\nThe [JSMin library](http://www.crockford.com/javascript/jsmin.html) used for JavaScript minification was originally written by Douglas Crockford and was [ported to PHP](https://github.com/mrclay/jsmin-php) by Ryan Grove specifically for use in Minify.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrclay%2Fminify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrclay%2Fminify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrclay%2Fminify/lists"}