Bundling dwr js with jawr - different md5

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

Bundling dwr js with jawr - different md5

jiri.pejchal
Hi,

I am using jawr for bundling dwr js files and use
MD5BundleHashcodeGenerator to generate md5 for each bundle in url.

However the resulting js bundle with dwr interfaces can have different
content between application runs - this can be a problem when caching
static resources of the same version of application deployed on
different servers.

I use spring support for both dwr and jawr.

Jawr takes lists of creator names from jawr:

https://github.com/ic3fox/jawr-dwr3.x/blob/master/jawr-dwr3.x-extension/src/main/java/net/jawr/web/resource/bundle/generator/dwr/DWR3BeanGenerator.java#L238

and generates interface scripts.


There are two problems:

1. the underlying collection for creator names doesn't provide
ordering guarantee
this can be solved on jawr side by sorting the creator names:
https://java.net/jira/browse/JAWR-401

2. there is no ordering guarantee for method names inside dwr interfaces.
Could the method names be returned each time in the same order
(sorted) on dwr side?
Or at least provide an option for doing so.

Jiri Pejchal
Reply | Threaded
Open this post in threaded view
|

Re: Bundling dwr js with jawr - different md5

Mike Wilson
Administrator
Thanks for the report, Jiri.

This seems like a valid issue so I have created
https://directwebremoting.atlassian.net/browse/DWR-660 
and scheduled for the next release.

Best regards
Mike Wilson

Jiri Pejchal wrote:

> Hi,
>
> I am using jawr for bundling dwr js files and use
> MD5BundleHashcodeGenerator to generate md5 for each bundle in url.
>
> However the resulting js bundle with dwr interfaces can have different
> content between application runs - this can be a problem when caching
> static resources of the same version of application deployed on
> different servers.
>
> I use spring support for both dwr and jawr.
>
> Jawr takes lists of creator names from jawr:
>
> https://github.com/ic3fox/jawr-dwr3.x/blob/master/jawr-dwr3.x-
> extension/src/main/java/net/jawr/web/resource/bundle/generator
> /dwr/DWR3BeanGenerator.java#L238
>
> and generates interface scripts.
>
>
> There are two problems:
>
> 1. the underlying collection for creator names doesn't provide
> ordering guarantee
> this can be solved on jawr side by sorting the creator names:
> https://java.net/jira/browse/JAWR-401
>
> 2. there is no ordering guarantee for method names inside dwr
> interfaces.
> Could the method names be returned each time in the same order
> (sorted) on dwr side?
> Or at least provide an option for doing so.
>
> Jiri Pejchal