Home  >  Article  >  Backend Development  >  Use Minify to optimize website performance_PHP tutorial

Use Minify to optimize website performance_PHP tutorial

WBOY
WBOYOriginal
2016-07-20 10:56:46854browse

Minify is an application developed in PHP5 that improves website performance by following some Yahoo optimization rules. It merges multiple CSS or JavaScript files, removes unnecessary whitespace and comments, performs gzip compression, and sets browser cache headers. Minify is very similar in design to Yahoo's Combo Handler Service, but Minify can merge any JavaScript and CSS files you want.

Generally, the bottleneck of website speed is at the front end, and the most critical thing is the loading speed of resources. However, most browsers have a limit on the number of concurrent requests for a single domain name, so if there are many requests on a page, Resources, such as CSS and JavaScript files, will obviously reduce the loading speed of the website. A better way to handle it is to access multiple files through one request. This will not affect the previous file maintenance and reduce the clear number of resources. Minify is made for this.

The following two pictures are a comparison of the website request time before Minify is enabled and after Minify is enabled. It can be seen that after Minify is enabled, the resource loading time is reduced from 250ms to 125ms, saving a total of 50% of the time. .


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/445823.htmlTechArticleMinify is an application developed with PHP5, which improves the performance of the website by following some Yahoo optimization rules. It will merge multiple CSS or JavaScript files, remove some unnecessary spaces and comments...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn