Changeset 10175
- Timestamp:
- 07/07/08 19:17:37 (2 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/sfCombineFilterPlugin/branches/kraven/README
r10090 r10175 3 3 The `sfCombineFilter` is an implementation of the [http://rakaz.nl/extra/code/combine CSS and Javascript Combiner] by Niels Leenheer. It makes your pages load faster by combining and compressing javascript and css files. 4 4 5 This filter provides means to automatically combine your included javascripts and stylesheets into one request each. All of the included files are combined into a single large file and compressed using gzip. The resulting file is cached and used every time that particular combination of files is used, until any of the files are changed at which pointa new cache is automatically created.5 This filter provides means to automatically combine your included javascripts and stylesheets into one request each. All of the included files are combined into a single large file. Compression is determined by the "compressed" setting in settings.yml The resulting file is cached and used every time that particular combination of files is used. If any of the files are changed a new cache is automatically created. 6 6 7 The symfony filter looks at all of the javascripts and stylesheets resources specified in the current response, and automatically creates a string that combines all of the names together. When your visitors request this special file, they will get one large file , gzipped and ready to go.7 The symfony filter looks at all of the javascripts and stylesheets resources specified in the current response, and automatically creates a string that combines all of the names together. When your visitors request this special file, they will get one large file. 8 8 9 9 For example, if you are including the following javascripts on every page: … … 14 14 * /js/slider.js 15 15 16 Using the combine script, you can combine all of these files into a single file by changing the URL to 17 * /js/packed/prototype.js,builder.js,effects.js,dragdrop.js,slider.js 18 19 The sfCombineFilter will do this automatically. Then, with the help of .htaccess and the included combine.php file in the /web folder, this request is routed to combine.php which uses the string of file names to either locate an existing cached file of the concatenated and compressed source or create a new one. 16 Using the combine script, you can combine all of these files into a single packed.js file 20 17 21 18 == Features == 22 19 23 20 * Support for automatic combination of javascript, css, or both 24 * Support for script exclusions based on file path (mainly used when css relies on a particular path to load images) 21 * Support for script exclusions (mainly for scripts that are incompatible with being packed like tiny_mce) 22 * Automatically replaces relative paths in css files with actual paths 23 * Support for css filtered paths for additional paths that need to be removed from the file path before replacing relative paths 25 24 * Cache that refreshes automatically when source files are changed 25 * Option to minimize the packed.js with JSMin 26 * Option to safe minimize the css 27 * Options to only pack/compress the javascript or css in /packed/js or /packed/css 28 * Filter utilizes client side caching to send 403 for unchanged cache files 26 29 27 30 == Installation == … … 36 39 === Enable the filter === 37 40 38 * In yourapp/config/filters.yml, add the sfCombineFilter. This must come AFTER "common":41 * In app/config/filters.yml, add the sfCombineFilter. This must come AFTER "common": 39 42 40 43 {{{ … … 50 53 sfCombineFilter: 51 54 class: sfCombineFilter 52 param: 53 javascripts: true 54 stylesheets: true 55 compress_js: true 56 compress_css: true 57 root_js_only: false 58 root_css_only: true 55 59 56 flash: ~ 60 57 execution: ~ 61 58 }}} 62 59 63 * In yourapp/config/routing.yml60 * In app/config/routing.yml 64 61 {{{ 65 62 download_packed_files: … … 68 65 }}} 69 66 70 * In yourapp/config/settings.yml67 * In app/config/settings.yml 71 68 72 69 add sfCombineFilter to enabled_modules: [] 73 70 74 By default all javascripts and stylesheets requested in /packed/js/ or /packed/css/ respectively are combined into one request each, whereas files requested outside of that path are ignored. You can turn off the filter all together for javascript or css by setting those parameters to "false". If you want to include files requested from any path and not just those inside /js or /css, then set the parameters "root_js_only" and "root_css_only" to false. 71 All settings are made in application/config/app.yml. See plugins/sfCombineFilterPlugin/config/app.yml for defaults and examples. You can turn off the filter all together for javascript or css by setting those parameters to "false". You can turn compression on or off by setting compress_js or compress_css. You can combine only the files in /packed/js and /packed/css by setting root_js_only and root_css_only to true. 72 73 == Known Issues == 74 75 Internet Explorer 6 has problems with large javascript files when gzip compression is on. If you experience strange issues with your pages in IE6, set compressed: off for you environment in settings.yml and it should resolve the problem 75 76 76 77 == Changelog ==