Frequently Asked Questions
I have a question or a suggestion, where can I post it?
- Are you using wro4j on your site? Have you implemented something similar yourself? If so, please let us know! If you have any questions or ideas about some features you would like to see, if it's working for you, we'd love to hear about it, and if it's not, well we'd love to hear about that too! You could post to the wro4j group: http://groups.google.com/group/wro4j
Where are the javadocs?
The javadocs for the latest version can be viewed here.
Why would I use wro4j?
- To improve the load time of your web application
Can I use wro4j for multiple files coming from a outside domains?
- It doesn't matter the location of the resources you want to include into your project. The resources can be located anywhere, at any domain.
Is there an IDE integration plugins for wro4j?
- Currently there is only a plugin for eclipse supported. For more details read this blog post.
What are the similar projects?
What is a resource processor & how can I create a custom one?
- This ResourceProcessors wiki page contains a detailed description about resource processors and will answer your question.
What's the best way to track new releases?
How to get the wro4j sources?
- Initially the sources were hosted by google code (svn checkout http://wro4j.googlecode.com/svn/trunk/), later a git scm was preferred and since 1.2.0 the codebase was moved to github (http://github.com/alexo/wro4j). Though after each realease, there is an attempt to synchronize code base from github with google code, there may be some issues. Therefore, a checkout from github is preferred and guarantee that you have the latest source version. More about how you can checkout source can be found in the GettingStarted page.
How can I change the Configuration Mode in the runtime
How to add easily custom resource processors
How to define processors used during processing?
Can I use wro4j for multiple files coming from a outside domains
- Yes. It doesn't matter at all where the resources are located: locally, remotely, somewhere on the your local network, ftp or on your disc. All you have to do, is to specify all these location in the wro.xml file.
Is wro4j only a runtime solution?
- Starting with 1.2 branch, wro4j provides a build time solution - maven plugin. A detailed description of how you can use it can be found at this page: MavenPlugin.
- Starting with 1.3.4 version, there is a command line utility available, called wro4j-runner
How to use TinyMCE with wro4j?
- Because TinyMCE loads the plugins dynamically, you can run into issues when attempting to "serve-up" the TinyMCE resources through wro4j. The solution is to create a group which contains all resources needed by TinyMCE at once: http://blog.scriptito.com/compressing-tinymce-with-wro4j
How to configure wro4j different depending on environment
- You can use Spring for this, more details here
Is it possible to switch switch minimization off during development?
- If you are running wro4j in DEVELOPMENT configuration mode, you can switch minimization off by adding minimize=false parameter to resource url, like this:
<script type="text/javascript" src="wro/all.js?minimize=false"></script>
You can read more about it minimize aware processors at this link: MinimizeAwareProcessor
I use an older version of wro4j (1.2.2 or 1.2.8). Should I upgrade to newer version?
- All the releases of wro4j are backward compatible. Therefore, you are encouraged to upgrade if you want to benefit from new features and bug fixes. The only problem you may have when switching from 1.2.x branch to 1.3.x branch is if you extend some wro4j code and do advanced stuff (which is very unlikely for regular users)
Is it possible to deploy an application using wro4j to GAE (Google Application Engine)?
- GAE has some limitations on deployed applications. For instance, you cannot use JMX or you cannot create threads from within deployed application. By default wro4j enables JMX usage. In order to be sure that wro4j is compliant with GAE limitations, you have to apply some changes:
<filter>
<filter-name>WebResourceOptimizer</filter-name>
<filter-class>
ro.isdc.wro.http.WroFilter
</filter-class>
<init-param>
<param-name>configuration</param-name>
<param-value>DEPLOYMENT</param-value>
</init-param>
<init-param>
<param-name>jmxEnabled</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>cacheUpdatePeriod</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>modelUpdatePeriod</param-name>
<param-value>0</param-value>
</init-param>
</filter>There are a couple of things to mention:
- jmxEnabled init param is set to false. This will disable the JMX usage of wro4j.
- cacheUpdatePeriod & modelUpdatePeriod are set to 0. That means that there will be no scheduler responsible for updating of the cache and model. By default these values are 0, so it could be easier just to not put any of these two init-params.
How to update the cache at runtime
- If JMX is enabled you can trigger cache and/or model update through jconsole
- Set the cacheUpdatePeriod and/or modelUpdatePeriod to 5 seconds in your web.xml (@see http://code.google.com/p/wro4j/wiki/GettingStarted)
- Trigger cache and/or model update through HTTP with a simple GET request:
- for cache update - /wro/wroAPI/reloadCache
- for model update - /wro/wroAPI/reloadModel
These requests will be processed only in DEVELOPMENT mode.
Are there any performance concerns?
When using wro4j build-time solution, you shouldn't worry. However if you prefer runtime solution, there are several aspects you must take care of:
- depending on number of resources and type of processors, the bundling can be CPU expensive.
- when using a public facing site (with a large number of users), don't forget to use DEPLOYMENT mode (equivalent of debug=false ). Also it is important to keep caching enabled (which is true by default).
- You can provide a custom caching strategy based on your application needs.
- You can turn on/off gzipping (use gzipResources=false ). This can be useful if you prefer CDN do handle the resource gzipping.
Read more about performance concerns.