| 1 | = Minify = |
| 2 | Browsers default to only downloading 2 files from the same origin at a time, so many files is very slow on high latency links. |
| 3 | |
| 4 | We therefore consolidate into fewer, larger files when running in Production mode. |
| 5 | |
| 6 | Although, note that iPhone 3.x cannot cache files larger than 15kb and in iPhone 4 the limit is 25kb. And this is the size before gzipping. |
| 7 | |
| 8 | Since GIS is a specialised app which requires many files, it's JS is loaded separately when required. |
| 9 | |
| 10 | The build script is {{{static/scripts/tools/build.sahana.py}}} |
| 11 | |
| 12 | It needs to be run as a web2py script: |
| 13 | {{{ |
| 14 | python web2py.py -S eden -M -R applications/eden/static/scripts/tools/build.sahana.py |
| 15 | }}} |
| 16 | |
| 17 | There is also a convenience wrapper for Windows to run this: {{{static/scripts/tools/build.cmd}}} |
| 18 | |
| 19 | You must have an internet connection to run the build script unless you have a local version of the Compiler. |
| 20 | |
| 21 | Our build process is based on the one used by !OpenLayers |
| 22 | * http://trac.openlayers.org/wiki/Profiles |
| 23 | |
| 24 | This uses Google's Closure compiler to compress the JS. This is done using their web service, however for !OpenLayers itself we need to download the jar file & place in the tools folder since this is over 1Mb: |
| 25 | * http://closure-compiler.googlecode.com/files/compiler-latest.zip |
| 26 | |
| 27 | !ToDo: Investigate using other options instead: |
| 28 | * http://developer.yahoo.com/yui/compressor/ |
| 29 | * http://www.crowproductions.de/repos/main/public/packer/jspacker.py |
| 30 | |
| 31 | !ToDo: Download/execute scripts asynchronously: |
| 32 | * Projects/Advanced/Optimisation |