-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Greenscript does not respect the staticDir:public route mapping #36
Comments
Adds a new IRouteMapper which provides an interface to the play Router for the Minimizer to map URLs from internal to external and vice versa.
I think this is to avoid browser to cache js/css file, while greenscript On Wed, Feb 15, 2012 at 10:37 AM, tazmaniax <
|
The idea is to only avoid browser caching if there is modified static content with a new release in which case everything should be reloaded. Maybe I should have done some more testing in production mode but my assumption was that the generated minimised files would have the same file name across new releases as they are generated based on the collection of minised file names contained and therefore another mechanism was needed to ensure modified static resources were guaranteed to be picked up on new version release. |
I am a bit confused. So to load modified static content you just need to On Wed, Feb 15, 2012 at 11:14 AM, tazmaniax <
|
Probably but when does an 'end user' know to do that? They might not even see the problem. On Mac ctrl-f5 doesn't exists and I don't know what the equivalent is. Not something I would want to rely on. If the client static content needs to be in sync with the server then it should be refreshed when the server is updated outside of the end user involvement, no? This change is only to handle application upgrades that affect content cached on the client. |
Well, if you are talking about the product environment, then what you need On Wed, Feb 15, 2012 at 9:39 PM, tazmaniax <
|
ok but then you really need to be consistent and apply versioning to every static resource including graphics and css. Clearly including a version as part of every static resource file name would be a much better fine grain solution then what I've suggested but then that doesn't play easily with SCMs etc - maybe GIT is better suited then most. This general URL mapping mechanism is applicable where there is no per resource versioning already in place, and the effort to introduce and manage such a mechanism is currently a barrier, which is in my case :) I'm looking at the static URL mapping as a quick win, accepting the fact that when the version is incremented clients are forced to download all resources again. A matter of tradeoffs. |
Fair enough. Let me think it twice. On Wed, Feb 15, 2012 at 10:19 PM, tazmaniax <
|
Cool. The change I've made, #37, seems to be working well and I've tested it on my Heroku cluster. I've added a configurable parameter to completely disable integration with the play Router. |
The following discussion suggests a mechanism to avoid browser cached resources when deploying a new application version: https://groups.google.com/d/msg/play-framework/1saij-OP1go/CcuN2VxxD4YJ
This mechanism involves inserting a version number contained in a local file into the external prefix for static 'public' resources, e.g.:
GET /public/%{out.write(play.getVirtualFile(".version").contentAsString())}%/ staticDir:public
Greenscript does not take this sort of mapping into account when returning URLs for managed resources.
The text was updated successfully, but these errors were encountered: