Minifying Files

One of the factors that effects search engine ratings is page loading speed. To improve page loading speed, the Breeze includes the ability to "minify" JavaScript and CSS files. Minification is the process of removing all white space (spaces, tabs, line feeds, carriage returns) and comments from the code to reduce the file size and thus shorten download time. This console is provided to perform exactly that function. Note: You may also set options such that minification occurs automatically upon publication of either JavaScript or CSS files. See Changing Site Options for more information on setting up automatic minification. In addition to the ability to minify JavaScript and CSS files, the Breeze pages can be setup to minify the page content (HTML, and any inline JavaScript and CSS) on-the-fly. This is done under Manage Page Attributes. For more information on managing page attributes, see Managing Page Attributes

Minify Files Console

To minify a JavaScript file, simply click on the button with the name of the JavaScript file. Note that the original source will be copied in /scripts/src/ where scripts is your included page scripts folder as defined by BWB_SCRIPTS_DIR in /connect/config.php. Note that not all JavaScript files can successfully be minified. Sometimes they quit working. There is a non-user editable table named bwb_no_minify where bwb_ is the table prefix as defined by BWB_TABLE_PREFIX in /connect/config.php. This table contains a list of Breeze pre-packaged JavaScript files that are known to have issues with minification and are therefore omitted from the list shown in the image above. If you write your own JavaScript file and you find it breaks after minification, you could add it to the list with the command:

INSERT INTO bwb_no_minify SET file_name = 'myjavascriptfile.js';

where myjavascriptfile is the name of your JavaScript file and bwb_ is the table prefix for your particular Breeze installation. You can run this command is the Run SQL console.

Note that backups of all files are kept in case something should go wrong. Backups are made hidden by prepending with a dot " . " and appending a 10-digit timestamp. You can use an FTP program or the file manager built into CPanel to recover the files if necessary.

Minification of CSS files is a lot less temperamental. Thus this is done with just one button Minify All CSS Files. As with JavaScript files, backups kept for CSS files as well. But when doing them in bulk, they are copied to a folder named /css/bkup0987654321/ where css is your CSS folder as defined by BWB_CSS_DIR in /connect/config.php, and 0987654321 is the 10-digit timestamp of the minification time.