diff --git a/min/README.txt b/min/README.txt index 2f59d41..a7cf774 100644 --- a/min/README.txt +++ b/min/README.txt @@ -84,22 +84,6 @@ You can now serve these files with this simple URL: http://example.com/min/?g=js -GROUPS: FAR-FUTURE EXPIRES HEADERS - -Minify can send far-future (one year) Expires headers. To enable this you must -add a number to the querystring (/min/?g=js&1234) and alter it whenever a -source file is changed. If you have a build process you can use a build/ -source control revision number. If not, the utility function Minify_groupUri() -will return "versioned" Minify URIs for use in your HTML. E.g.: - -"; - - GROUPS: SPECIFYING FILES OUTSIDE THE DOC_ROOT In the groupsConfig.php array, the "//" in the file paths is a shortcut for @@ -115,6 +99,34 @@ return array( ); +FAR-FUTURE EXPIRES HEADERS + +Minify can send far-future (one year) Expires headers. To enable this you must +add a number to the querystring (e.g. /min/?g=js&1234 or /min/f=file.js&1234) +and alter it whenever a source file is changed. If you have a build process you +can use a build/source control revision number. + +If you serve files as a group, you can use the utility function Minify_groupUri() +to get a "versioned" Minify URI for use in your HTML. E.g.: + +"; + + +DEBUG MODE + +In debug mode, instead of compressing files, Minify sends combined files with +comments prepended to each line to show the line number in the original source +file. To enable this, set $min_allowDebugFlag to true in config.php and append +"&debug=1" to your URIs. E.g. /min/?f=script1.js,script2.js&debug=1 + +Known issue: files with comment-like strings/regexps can cause problems in this mode. + + QUESTIONS? http://groups.google.com/group/minify \ No newline at end of file diff --git a/min/index.php b/min/index.php index 9673d54..3a19a21 100644 --- a/min/index.php +++ b/min/index.php @@ -29,15 +29,14 @@ if (0 === stripos(PHP_OS, 'win')) { if ($min_allowDebugFlag && isset($_GET['debug'])) { $min_serveOptions['debug'] = true; } +// check for URI versioning +if (preg_match('/&\\d/', $_SERVER['QUERY_STRING'])) { + $min_serveOptions['maxAge'] = 31536000; +} if (isset($_GET['g'])) { // well need groups config $min_serveOptions['minApp']['groups'] = (require MINIFY_MIN_DIR . '/groupsConfig.php'); - // check for URI versioning - if (preg_match('/&\\d/', $_SERVER['QUERY_STRING'])) { - $min_serveOptions['maxAge'] = 31536000; - } } - if (isset($_GET['f']) || isset($_GET['g'])) { // serve! Minify::serve('MinApp', $min_serveOptions);