diff --git a/NEWS.txt b/NEWS.txt index f6b502c87d392086a348203665c88b09ef154add..b75e4865e712f43453218ff788db06e578e3fc41 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -415,36 +415,47 @@ Caching Framework when needed. * Compression and concatenation of CSS and JavaScript files -New built-in minification routines can now be used with config.compressCss and -config.compressJs to reduce the file size of all files configured in -page.includeCSS and page.includeJS. Single files can be excluded from -compression using the new option disableCompression. Additionally, files can -be concatenated into a single file using config.concatenateCss and -config.concatenateJs. Please note that there is only limited support for -@charset, @import and @namespace statements in concatenated CSS files. +Built-in minification routines can now be used with config.compressCss to +reduce the size of all files configured in page.includeCSS. +With compressCss and/or compressJs enabled, CSS files and JavaScript files +(included using page.includeJS) can be saved and delivered with GZIP +compression in the Frontend, assuming $TYPO3_CONF_VARS['FE'] +['compressionLevel'] is set. +Similar to $TYPO3_CONF_VARS['BE']['compressionLevel'] (available since TYPO3 +4.4), the following options must be set in .htaccess: + + <FilesMatch "\.js\.gzip$"> + AddType "text/javascript" .gzip + </FilesMatch> + <FilesMatch "\.css\.gzip$"> + AddType "text/css" .gzip + </FilesMatch> + AddEncoding gzip .gzip + +Single files can be excluded from compression using the new option +disableCompression. Additionally, files can be concatenated into a single file +using config.concatenateCss and config.concatenateJs. Please note that there is +only limited support for @charset, @import and @namespace statements in +concatenated CSS files. Together with config.removeDefaultJS = external -these routines will significantly lower web site traffic. +these routines will significantly increase your website speed! -Furthermore, if compressCss/compressJs is enabled, -$TYPO3_CONF_VARS['FE']['compressionLevel'] now also affects CSS and JS files in -frontend and applies GZIP compression. This requires the same options as for -$TYPO3_CONF_VARS['BE']['compressionLevel'] to be set in .htaccess. - -You may disable compression and/or concatenation on the PAGE object. Example: +You may disable compression and/or concatenation for CSS and JavaScript included +with the PAGE object. Example: page.includeJSlibs { - jquery = http://code.jquery.com/jquery-1.6.1.min.js - jquery.external = 1 - jquery.disableCompression = 1 - jquery.excludeFromConcatenation = 1 + jquery = http://code.jquery.com/jquery-1.6.1.min.js + jquery.external = 1 + jquery.disableCompression = 1 + jquery.excludeFromConcatenation = 1 } The same options apply for includeCSS. Please note that compression and concatenation apply for external resources as -well. But if activated, they will be dynamically retrieved to allow requested -processing and will be served locally. +well. If activated, external resources will be dynamically retrieved, processed, +and served locally. \ No newline at end of file diff --git a/_.htaccess b/_.htaccess index 899c0d2798f016fc19c4333d9c66bc297c26fc88..3c623c2b928392fd0c1dde620303a0eb2f19db14 100644 --- a/_.htaccess +++ b/_.htaccess @@ -37,8 +37,10 @@ # Compressing resource files will save bandwidth and so improve loading speed especially for users # with slower internet connections. TYPO3 can compress the .js and .css files for you. -# 1) Uncomment the following lines and -# 2) Set $TYPO3_CONF_VARS['BE']['compressionLevel'] = '9' +# *) Uncomment the following lines and +# *) Set $TYPO3_CONF_VARS['BE']['compressionLevel'] = '9' for the Backend +# *) Set $TYPO3_CONF_VARS['FE']['compressionLevel'] = '9' together with the TypoScript properties +# config.compressJs and config.compressCss for GZIP compression of Frontend JS and CSS files. #<FilesMatch "\.js\.gzip$"> # AddType "text/javascript" .gzip diff --git a/typo3/sysext/t3editor/res/tsref/tsref.xml b/typo3/sysext/t3editor/res/tsref/tsref.xml index 9f9dd37af18799052f61dabf2d7c357e9fa821ed..dee1db7b841cf7f50fb0b764ca4711b332c469e7 100644 --- a/typo3/sysext/t3editor/res/tsref/tsref.xml +++ b/typo3/sysext/t3editor/res/tsref/tsref.xml @@ -857,9 +857,11 @@ config.removeDefaultJS = 1]]></description> <default><![CDATA[false]]></default> </property> <property name="compressJs" type="boolean"> - <description><![CDATA[If set, inline JavaScript and external JavaScript files will be minified and compressed. + <description><![CDATA[Enabling this option together with $TYPO3_CONF_VARS['FE']['compressionLevel'] in the Install Tool delivers Frontend JavaScript files using GZIP compression. -Minification will remove all excess space. The more significant compression step (using Gzip compression) requires $TYPO3_CONF_VARS['FE']['compressionLevel'] to be enabled in the Install Tool together with the gzip-related compressionLevel options in .htaccess, as otherwise the files will not be readable by the user agent. +This can significantly reduce file sizes of linked JavaScript files and thus decrease loading times. + +Please not that this requires .htaccess to be adjusted, as otherwise the files will not be readable by the user agent. Please see the description of $TYPO3_CONF_VARS['FE']['compressionLevel'] in the Install Tool. Example: