Question

Is there a way in JSF to use a combined resource across a cluster? Basically I'm looking for a solution where the first server in the cluster to introduce the resource could synchronize that to the resource cache of the other servers.

Was it helpful?

Solution

This was not possible because the unique ID of the combined resource was generated based on MD5 which is an irreversible one-way encryption. So if the resource is created on server X and requested on server Y, then server Y won't be able to resolve the resources from the cache based on the unique ID.

Since OmniFaces 1.2 this has been fixed by replacing the MD5 approach by a combination of ZLIB and Base64 which makes it short and reversible. Server Y will now be able to resolve the resources itself based on the ID and then store in the cache.

There's by the way an additional step to the Base64 encoding approach in form of replacing the /, + and = characters by ~, - and _ to make it URL-safe so that it can without any much possibly platform-sensitive URL-encoding hassle be passed through URLs.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top