ZF-7094: External dynamic JavaScript code

Issue Type: New Feature Created: 2009-06-23T02:27:01.000+0000 Last Updated: 2009-06-23T04:57:28.000+0000 Status: Resolved Fix version(s): Reporter: vincent (vistahr) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Dojo

Related issues: Attachments:


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


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');


Posted by Matthew Weier O'Phinney (matthew) on 2009-06-23T04:56:08.000+0000

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.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.