Compressed 'ConcatResourceBundleReference'?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Compressed 'ConcatResourceBundleReference'?

pasto
Hi,

Is there an easy way to use ConcatResourceBundleReference to merge compressed JavaScriptResourceReferences? From the source code it seems, that ConcatResourceBundle merges streams obtained by 'getCacheableResourceStream', but those are not compressed, as compression is done in 'processResponse', that is called from 'newResourceResponse' in the PackageResource.
Wouldn't it be better just wrap the resource stream and override the getInputStream in case of js/css compression?
Most probably I'm missing something, but I can't figure out, how to bundle compressed package resource references without building my own ConcatResourceBundle.

Thank you,
Peter.
Reply | Threaded
Open this post in threaded view
|

Re: Compressed 'ConcatResourceBundleReference'?

Emond Papegaaij
Hi Peter,

The most effective way to bundle compressed resources is to pre-process
them. JavaScriptResourceReference automatically uses pre-minified files if
available. Your minified js file needs to have the same name, ending with
.min.js. There is a maven plugin that uses the yui compressor to minify the
files at build time. This is also used by Wicket itself, so check the
Wicket parent pom for an example. Pre-processing js files also saves
cpu-time on your server.

Best regards,
Emond
Op 25 sep. 2012 19:15 schreef "pasto" <[hidden email]> het
volgende:

> Hi,
>
> Is there an easy way to use ConcatResourceBundleReference to merge
> compressed JavaScriptResourceReferences? From the source code it seems,
> that
> ConcatResourceBundle merges streams obtained by
> 'getCacheableResourceStream', but those are not compressed, as compression
> is done in 'processResponse', that is called from 'newResourceResponse' in
> the PackageResource.
> Wouldn't it be better just wrap the resource stream and override the
> getInputStream in case of js/css compression?
> Most probably I'm missing something, but I can't figure out, how to bundle
> compressed package resource references without building my own
> ConcatResourceBundle.
>
> Thank you,
> Peter.
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Compressed-ConcatResourceBundleReference-tp4652338.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Compressed 'ConcatResourceBundleReference'?

Martin Grigorov-4
In reply to this post by pasto
Hi,

See what Emond suggested.
Otherwise the problem is known:
https://issues.apache.org/jira/browse/WICKET-4762

P.S. Is wicket-portlet:6.0.0 coming ? :-)

On Tue, Sep 25, 2012 at 8:15 PM, pasto <[hidden email]> wrote:

> Hi,
>
> Is there an easy way to use ConcatResourceBundleReference to merge
> compressed JavaScriptResourceReferences? From the source code it seems, that
> ConcatResourceBundle merges streams obtained by
> 'getCacheableResourceStream', but those are not compressed, as compression
> is done in 'processResponse', that is called from 'newResourceResponse' in
> the PackageResource.
> Wouldn't it be better just wrap the resource stream and override the
> getInputStream in case of js/css compression?
> Most probably I'm missing something, but I can't figure out, how to bundle
> compressed package resource references without building my own
> ConcatResourceBundle.
>
> Thank you,
> Peter.
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Compressed-ConcatResourceBundleReference-tp4652338.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>



--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Compressed 'ConcatResourceBundleReference'?

pasto
In reply to this post by Emond Papegaaij
Hi Emond,

thank you for your reponse. This is not a suitable solution for me, as I would like to be able to modify the resources after the deployment. Anyway, yesterday I have implemented my own JavaScriptPackageResource and CssPackageResource, that overrides the original "getCacheableResourceStream" and does the compression there (and also caches the result), so now the resource bundles work just fine for me.

Peter.

On Tue, Sep 25, 2012 at 9:59 PM, Emond Papegaaij [via Apache Wicket] <[hidden email]> wrote:
Hi Peter,

The most effective way to bundle compressed resources is to pre-process
them. JavaScriptResourceReference automatically uses pre-minified files if
available. Your minified js file needs to have the same name, ending with
.min.js. There is a maven plugin that uses the yui compressor to minify the
files at build time. This is also used by Wicket itself, so check the
Wicket parent pom for an example. Pre-processing js files also saves
cpu-time on your server.

Best regards,
Emond
Op 25 sep. 2012 19:15 schreef "pasto" <[hidden email]> het
volgende:

> Hi,
>
> Is there an easy way to use ConcatResourceBundleReference to merge
> compressed JavaScriptResourceReferences? From the source code it seems,
> that
> ConcatResourceBundle merges streams obtained by
> 'getCacheableResourceStream', but those are not compressed, as compression
> is done in 'processResponse', that is called from 'newResourceResponse' in
> the PackageResource.
> Wouldn't it be better just wrap the resource stream and override the
> getInputStream in case of js/css compression?
> Most probably I'm missing something, but I can't figure out, how to bundle
> compressed package resource references without building my own
> ConcatResourceBundle.
>
> Thank you,
> Peter.
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Compressed-ConcatResourceBundleReference-tp4652338.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>



If you reply to this email, your message will be added to the discussion below:
http://apache-wicket.1842946.n4.nabble.com/Compressed-ConcatResourceBundleReference-tp4652338p4652346.html
To unsubscribe from Compressed 'ConcatResourceBundleReference'?, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: Compressed 'ConcatResourceBundleReference'?

pasto
In reply to this post by Martin Grigorov-4
Hi Martin,

i'm, not sure, if i'll have time to migrate the wicket portlet to wicket 6 so soon. Currently I've only started using Wicket 6 for my private projects. Portlets are necessary evil, that we have to use at work, so it has to wait for some new project, where we apply it. That's why the enterprise world is always behind the opensource :).

Peter.


Reply | Threaded
Open this post in threaded view
|

Re: Compressed 'ConcatResourceBundleReference'?

pasto
But, I think, that the migration of Wicket Portlet should not be that difficult, as I have the feeling, that there were not so many changes as between 1.4 and 1.5. Maybe some changes with ajax handling...
Reply | Threaded
Open this post in threaded view
|

Re: Compressed 'ConcatResourceBundleReference'?

Martin Grigorov-4
I also believe it shouldn't be difficult.

On Wed, Sep 26, 2012 at 10:20 AM, pasto <[hidden email]> wrote:

> But, I think, that the migration of Wicket Portlet should not be that
> difficult, as I have the feeling, that there were not so many changes as
> between 1.4 and 1.5. Maybe some changes with ajax handling...
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Compressed-ConcatResourceBundleReference-tp4652338p4652359.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>



--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]