lauripiispanen/grails-resources — comment on commit 69399d7ffa4633c952e442aa6127cdb3f82066a9
File:  line 0
By marcpalmer:

On 12 Dec 2011, at 19:31, Lauri Piispanen wrote:

> That's true, but not all /static/ requests target ad-hoc resources, and there's no way of knowing whether or not an ad-hoc request hits any existing resource besides a lookup of that file, right? Problem in this case is that when memoizing the resource for given URL, the lookup doesn't check if the file exists on the disk, but instead just assumes that it doesn't. It relies on the fact that user would have arrived through the legacy URL to the ad-hoc resource for the first time...
>
> But users may also arrive to an ad-hoc resource directly to the /static/-prefixed URL - e.g. if another server in the cluster creates the link and a load balancer round-robins it to a freshly attached instance.
>
> I was wondering, would it maybe be possible to use a different prefix for ad hoc resources? This would reduce ambiguity between bundles and ad hoc resources.
>

Actually I think the fix is to check if the resource under /static/ is known to the plugin. If not, check if the file with that URI exists in the work dir, and i it does render it. Otherwise 404.

It's that middle step we don't do currently, and its needed to continue serving old versions of resources for people who have pages loaded/cached that reference them.

Marc

~ ~ ~
Marc Palmer
Freelancer (Grails/Groovy/Java)

Founder @ http://noticelocal.com | Developer @ http://weceem.org
Member @ http://spottymushroom.com | Contributor @ http://grails.org
Twitter: http://twitter.com/wangjammer5 | Resumé: http://www.anyware.co.uk/marc/
Blog: http://www.anyware.co.uk | Grails Rocks: http://www.grailsrocks.com