1024programmer Blog Nginx+php+minify compresses your css, js detailed explanation

Nginx+php+minify compresses your css, js detailed explanation

Minify is used for server-side combined minification of JavaScript and CSS.

1. First download Minify from Google code

http://code.google.com/p/minify/wiki/UserGuide

2. Upload to the root directory of the website, of course, you can also specify the location, but it should be noted that Minify needs to be modified.

3. Modify Nginx configuration, please refer to my previous article:

Minify rewrite configuration on Nginx

P.S. The purpose of adding redirection is to merge the compressed js and css code path without carrying it?

4. Modify the Minify configuration file

[php]
view plain
copy

  1. <?php
  2. / **

  3. * Configuration for default Minify application
  4. * @package Minify
  5. */
  6. }

Then you can access it like this:

[html]
view plain
copy

  1. http://www.abc.com /min/f=/style/global.css

[html]
view plain
copy

  1. http://www.abc.com /min/f=/style/global.css,/style/index.css,/css /abc.css

adding-top:1px; padding-right:1px; padding-bottom:1px; padding-left:1px; size:9px; display:inline-block; width:16px; height:16px; text-indent:-2000px”>view plain
copy

  1. http://www.abc.com /min/f=/style/global.css,/style/index.css,/css /abc.css

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/nginxphpminify-compresses-your-css-js-detailed-explanation/

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索