This project is archived and is in readonly mode.

#385 ✓resolved
Ruy Asan

Small confusion around config.action_view.cache_template_loading

Reported by Ruy Asan | June 11th, 2008 @ 03:12 AM

Changes introduced by "this patch": http://github.com/rails/rails/co... create a small bit of confusion because of the overlap with @config.cache_classes@:

config.cache_classes = true
config.action_view.cache_template_loading = true
# - no STAT call each request, no reloading templates
# - expected behaviour
# - default for prod env

config.cache_classes = false
config.action_view.cache_template_loading = false
# - STATs every request, full view path check every request
# - expected behaviour
# - default for dev env

config.cache_classes = true
config.action_view.cache_template_loading = false
# - STATs every request, but no rechecking process_view_paths
#       i.e. won't discover new files, but will update existing ones
# - pretty much expected behaviour IMO
# - probably quite a rare setup

config.cache_classes = false
config.action_view.cache_template_loading = true
# - no STATs, HOWEVER, process_view_paths gets executed every request...
#     i.e. (Dir.glob("#{dir}/**/*/**") | Dir.glob("#{dir}/**")).each do |file| ...
#     i.e. STAT calls are really not going to be your main problem
# - somewhat confusing because reloading classes doesn't really imply rechecking views
# - but most people won't think this far...
# - also probably quite rare

It's not a big deal, but it seems to be a fairly unnecessary source of potential confusion.

Proposed solution:

  • Rename config.cache_classes to something more all-encompassing like config.reload_app_each_request.
  • Get rid of config.cache_template_loading entirely and have ActionView::TemplateHandlers::Compilable#compile_template? check config.reload_app_each_request directly instead.

I don't think anyone actually needs this level of granularity. "reload_app_each_request" is blunt, but descriptive and easy to reason about.

Comments and changes to this ticket

  • josh

    josh July 12th, 2008 @ 05:54 PM

    • State changed from “new” to “open”
    • Assigned user set to “josh”
    • Tag set to actionpack, minor, railties
  • josh

    josh July 12th, 2008 @ 05:56 PM

    Wait a few more days, then we'll discuss again. I'm putting in another large view path/compiling patch.

    I do agree w/ you though.

  • josh

    josh July 12th, 2008 @ 08:39 PM

    Big change -http://github.com/rails/rails/co...

    Another thing that should happen. Template attributes should be lazy loaded in development and eager loaded and frozen in production.

    I'm sort of thinking they should all be stuff under cache_classes.

  • josh

    josh July 16th, 2008 @ 04:06 AM

    • State changed from “open” to “resolved”

    I'm going close this for now. I may open a thread on the mailing list if I'm not sure what I'm going to do. I'll get to it soon though.

  • adevadeh

    adevadeh September 24th, 2008 @ 11:25 AM

    • Tag changed from actionpack, minor, railties to actionpack, minor, railties

    not sure what is happening with this ticket, but just FYI: we have a setup where the app classes need to stay around, but we would really like to reload the views (the third option listed). Merging the two options into a single one causes problems what we could only workaround by hacking Rails.

  • Stephen Reid

    Stephen Reid January 20th, 2009 @ 01:19 AM

    I too have been using the third option. Having just upgraded to 2.2.2 I am disappointed to see I can no longer reload views without reloading the entire app (reloading the entire app is slow in Windows =/). Can we reintroduce some way of accomodating this?

  • Eric Mill

    Eric Mill October 3rd, 2009 @ 02:32 AM

    Who says "I'll get to it soon, but until I do, I'm marking it resolved"??

  • Ruy Asan

    Ruy Asan June 11th, 2010 @ 11:46 PM

    Just FYI, cache_template_loading has indeed been removed in favor of simply cache_classes. 'Case google brought you here and are wondering.

    I still think the name is less then ideal because views != classes grumble grumble but we'll live.

  • ssupreme11

    ssupreme11 May 10th, 2011 @ 10:38 PM

    • Importance changed from “” to “”

    Its my first time to visit this site and as I was exploring I cant believe that this site was made up of a very informative articles that you should try to have compliment with so as what I am doing now I really love to look forward with more interesting information on this site.. Custom Dissertation Writing

  • KMike

    KMike May 18th, 2011 @ 05:46 PM

    Dear Ruy,

    We get the same error in our workspace database and for whatever reason on PC geek cannot fix it. How do I contact your (PM?) to get help? Please, let me know. Thanks a mill!

    Mike
    college essay help

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages