Home Forums Resources Minify PHP – How to Combine, Minify and Cache JavaScript and CSS files on demand

This topic contains 0 replies, has 1 voice, and was last updated by  Support 4 years, 10 months ago. This post has been viewed 31161 times

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #9999938

    Support
    Keymaster

    In this tutorial you will learn how to use Minify. Minify is a PHP5 app that helps you follow several of Yahoo!’s Rules for High Performance Web Sites. It combines multiple CSS or Javascript files, removes unnecessary whitespace and comments, and serves them with gzip encoding and optimal client-side cache headers. Let’s Go:

    1) Download Minify and extract the “min” folder inside of the root folder of your website (only the “min” folder!).

    2) Combine all the CSSs and JSs files in only one call:

    Before:


    After:


    Javascripts:

    * Files separated by comma – e.g: (/min/f=vendor/jquery.js,js/plugins.js,js/file1.js,js/file2.js) That’s All!
    * More information: http://code.google.com/p/minify/wiki/UserGuide
    ** If your website is in a subdirectory, then you’ll need to adjust the way you use Minify to rewrite CSS correctly: http://code.google.com/p/minify/wiki/AlternateFileLayouts
    *** Commom Problems: http://code.google.com/p/minify/wiki/CommonProblems


    • This topic was modified 7 months, 2 weeks ago by  Support2.
    • This topic was modified 7 months, 2 weeks ago by  Support2.
    • This topic was modified 7 months, 2 weeks ago by  Support2.
    • This topic was modified 7 months, 2 weeks ago by  Support2.
    • This topic was modified 7 months, 2 weeks ago by  Support2.
    • This topic was modified 7 months, 2 weeks ago by  Support2.
Viewing 1 post (of 1 total)