Issues

ZF-7094: External dynamic JavaScript code

Description

It would be cool, if i can define an external script path.

Zend_Dojo_View_Helper_Dojo::setUseExternal('/public/scripts');

Zend_Dojo creates new files in this path with the JS code instead adding this to the body. Pages with a lot of Dojo Elements would have a better performance, cause external code will cached in the browser.

The setUseExternal method can have 2 second attribute for the environment. Zend_Dojo_View_Helper_Dojo::setUseExternal('/public/scripts','dev'); So i can set it to development and Zend_Dojo will delete and create for evry refresh a new file.

For production, it´ll only load the external dynamic created file(s). Zend_Dojo_View_Helper_Dojo::setUseExternal('/public/scripts','prod');

Comments

You're not providing nearly enough information here for me to work with. The argument to your "setUseExternal" looks a lot like a local path, and I'm failing to see how that's different than simply providing a local path to Dojo in the helper.

Additionally, there are much better mechanisms for speeding up dojo: custom builds and CDNs. Custom builds intern all specified Dojo modules into a single file, including all templates, strips whitespace, and performs minification heuristics to ensure the smallest payload possible to the client. Pointing to a CDN is useful, as it allows your browser to use caches it already has in order to load the required functionality.