Hi Cezary,
I think I have the same need as you.
We use load balanced servers, and when upgrading we upgrade one at a
time so that there is always a server running.
But the side effect is that the upgraded server can receive requests for
the old assets, and we don't want to fail in this case.
In the past (5.1) I monkey-patched AssetResourceLocatorImpl to allow <=
version number requests.
However in migrating to 5.3 I would like a better solution, and the
implementation is different now anyway.
I like the idea of the 302 redirect.
How did you end up solving this? Is it possible to just contribute your
own AssetDispatcher instead of just replacing the class?
Thanks, Paul.
On 24/03/2011 10:09 AM, Cezary Biernacki wrote:
Perhaps the AssetDispatcher could check the requested version number and if
it doesn't match the app version, send a 302 redirect to the "correct" URL?
/assets/1.3/ctx/script.js --> /assets/1.2/ctx/script.js
Or perhaps it should only deliver the asset if the requested version os
older than or equal to the app version?
Determining "older" and "newer" would however assume people name their
application versions in a certain way.
It is exactly what I did in my application. I have overridden
AssetsDispatcher service with my copy based on original one, that differs
only in handling missing resources: if resource actually exists but just
version numbers differ, my dispatcher just sends redirect response with a
correct path.
As a side note, I observed in that - at least in my case - typically a
favicon was a typical asset requested with wrong version number, probably
from bookmarks.
Regards,
Cezary
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org