cubicweb #1161 make one big js bundle file for an installed instance [deprecated]
cubicweb-ctl create / upgrade commands could gather all js files from all the cubes used by the instance, concat them, and then run a packer (yui packer or whichever seems to be the best). The result would be stored in a file named cubicweb-bundle.js and this file would be the only javascript file included in the html header. Subsequent calls to req.add_js() would have no effect in "installed" mode. The idea is also applyable to CSS files (except for the packer part). | |
priority | normal |
---|---|
type | enhancement |
done in | <not specified> |
load | 0.000 |
load left | 0.000 |
closed by | <not specified> |
similar entities
Comments
-
2008/11/21 07:29, written by adimascio
- generate a big CSS and JS bundle file (with cat + a js packer)
- in external_resources, the JAVASCRIPTS AND STYLESHEETS
variables are assigned to those big bundle files only.
- in external_resources, I added two PACKED_JAVASCRIPTS and
PACKED_STYLESHEETS variables that list the packed CSS and JS files.
- I patched RequestBase.add_js and RequestBase.add_css methods
so that when a js (or css) is added, nothing is done if the file is
in the list defined by the corresponding PACKED_XXX variable.
-
2009/04/06 12:19, written by fcayre-old
add commentFor a recent cube I've been working on, I came with the following approach :
I have used such tricks recently, but when it comes to page loading optimization through http request optimization, I think we need something more powerful, like yahoo does to easily include several js or css at once : a specific view that would concatenate them on the fly (+ packing/ caching/ generating the right http cache parameters in installed mode) and deliver a single file for the page. It does not say anything about how to choose the files to be concatenated and to handle the subsequent req.add_js / req.add_css calls in the chosen views though. One also has to think about it also.