Note: You should always enable caching using Minify::setCache(). For the examples this can be set in config.php.

Minify Example 2: Minifying Everything

In this example, external Javascript and CSS minification is identical to example 1, but here Minify is also used to minify and serve the HTML, including the contents of all <style> and <script> elements.

As the document is XHTML, Minify_HTML places the 2nd <script> element in a CDATA section because it contains "<". The output is valid XHTML.

Validate XHTML

Minify tests

Test client cache

When you click here to reload the page, your browser should not have to re-download any files.

extras index »

lastModified ,$cssBuild->lastModified ); Minify::serve('Page', array( 'content' => $content ,'id' => __FILE__ ,'lastModifiedTime' => $pageLastUpdate // also minify the CSS/JS inside the HTML ,'minifyAll' => true ));