-
Notifications
You must be signed in to change notification settings - Fork 21.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed config.action_view.cache_template_loading, use config.cache_c…
…lasses instead
- Loading branch information
Showing
8 changed files
with
20 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
require 'action_controller/performance_test' | ||
|
||
ActionController::Base.perform_caching = true | ||
ActionView::Base.cache_template_loading = true | ||
ActiveSupport::Dependencies.mechanism = :require | ||
Rails.logger.level = ActiveSupport::BufferedLogger::INFO |
83e29b9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so, as of this commit, is there no longer a way to have view code recompile without recompiling classes as well?
83e29b9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could turn off ActionView::PathSet::Path.eager_load_templates by hand.
This was so rarely used that it because configuration noise.
83e29b9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m surprised at this also! I know Rails tries to encourage best practices so I don’t mind that the templates do not reload by default because best practices dictate you should only update production templates via a deployment system like Capistrano that will restart the application when done with the template update.
But not everybody lives in that ideal world. I work with a lot of people coming from the static HTML and PHP world where they are used to being able to make simple text changes on the production server and not need a “professional” to make every text change. They assume the risk associated with this style of development to save on costs. Restarting the application after every text change is out of their league also as they are not comfortable with the command line (they update the files via FTP manually). Obviously Rails should encourage people away from this style of development but I have always found it useful that this style of development was possible. I don’t even mind changing a config value to enable it.
This change (6 months old but not all of us live on the edge) now means that if I choose to allow this style of development I am also punished into having ALL of my classes reload on every request! Old versions of Rails where smart enough to check timestamps and only reload what needs to be reloaded. I consider this a step backwards.
Just my two cents.
83e29b9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eric I kind of want that functionality back too, but its a bit more difficult now
PID :)
83e29b9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe he means PDI ;)
anyway, you can use passenger and just touch tmp/restart.txt in the meantime, it’s not some huge ordeal like restarting a monit-managed mongrel-farm
83e29b9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’d like this back as well. It’s very useful when restarting your app is expensive. Say when you’re dealing with 200 req/sec in prime time and your visitors would feel slowdown if everything was bounced.
83e29b9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@josh, I don’t understand why it would be so difficult to restore the functionality.
Seems to me that we could just add “config.action_view.cache_template_loading” back. If true (the default to encourage best practices) then updates to templates do not affect the running application. If false then it would still cache the compiled template (for performance) but prior to running it, a quick check of the template’s last modified time-stamp would be done. If the template is newer than the cached value in memory then invalidate the cache and re-compile the template. Otherwise just use the compiled template already in memory.
So developer have a choice of “super-fast but inflexible (and if you are using standard deployment techniques this inflexibility won’t get in your way)” or “fast (since only changed templates are re-processed) but flexible”.
83e29b9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eric You make it sound so easy :)
If you can make a patch, I’d be happy to apply it.
83e29b9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another vote for bringing this back. The need for a full restart is just too painful for small changes on the views and reduces the overall availability of the app. At least this is my experience.
83e29b9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we all agree it should be back. So at this point, we probably need a patch and not only votes :)
83e29b9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 lifo ;)
83e29b9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have this exact “timestamping-on-change-reloading-templates” implemented in my fork of rails-dev-boost (the plugin patches a few things to get production like speeds in dev mode).
It is implemented against Rails 2.2 APIs though… I’ll have a look how portable it is for the 2.3 branch.
83e29b9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for bringing this back :)
83e29b9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the plugin to be compatible with Rails 2.3.
The implementation is obviously not thread safe… after all I only care about the speedy development mode.
83e29b9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Patch for bringing it back:
http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/1909
Comments appreciated!
83e29b9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this removed? This really increases my development time. I have a programmer who only modifies erb code and this is super annoying to have requests that take 3-4 seconds. Please reconsider adding this back in 3.1.
83e29b9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is already in 3.1