I suspect the 302 redirect may be the correct solution, and Tapestry could support this pretty reasonably.
The perfect solution would involve the following: - The version number if replaced with the SHA1 hash of the resource's (uncompressed) content - All CSS is dynamically rewritten to convert relative references into full paths including the correct SHA1 hash I wonder if the 302 redirect could act as a way to avoid rewriting the CSS? On Sun, Feb 19, 2012 at 7:57 PM, Paul Stanton <p...@mapshed.com.au> wrote: > 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 > -- Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.com --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org