Hi!

I've started an experiment with our AddResource stuff - again.

As you might know, we provide the StreamingAddResource which allows to add resources like javascript or css to the page without the need to buffer it and parse the response. Performance wise it should be a speedup, but StreamingAddResource needs some "nasty" tricks to get the css stuff in (I don't want to go into detail here, just e.g. threads, resource caching with timeout, ...).

During playing around with the PPR stuff I had the idea to use dojo to deal with this.

So I created the DojoAddResource (tomahawk-sandbox: org.apache.myfaces.custom.dojoaddresource.DojoAddResource).

Much like the StreamingAddResource it will simply embedd any style or javascript into the page when requests (i.e. by not honoring the position info), but instead of using the "nasty" trick I simply use dojo.html.insertCssFile. Ok - this also is somehow tricky - but now it is no longer "my beer" ;-)

Please give it a try. If you already use dojo components within your page it should not introduce any additional negative performance impact, otherwise dojo needs to be loaded which might take some time the first time.
It is not well tested, anyway.

Ciao,
Mario

Reply via email to