Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Default value for cache_sources in production #260

Closed
tompesman opened this Issue · 4 comments

5 participants

@tompesman

Hello,

Why is the default value for the cache_sources not set to true in the production environment by default? It is obvious this option should be set to false in the development environment, but in production there are no drawbacks to set this option to true.

Right now I've set in my config/rabl.rb the line: config.cache_sources = !(Rails.env == 'development')

I think this might be a missed opportunity as the performance gain can be significant.

Thanks!

@databyte
Collaborator

Mine is set to config.cache_sources = Rails.env != 'development'

I'll change the commented out copy for new projects. I think when we move to v1, it'll be a good time to adjust the internal defaults to use this and allow config.cache_sources as a way to turn it off or customize it. Good call.

related: Issue #216

@databyte databyte closed this
@micho

We've been running rabl in production for a while and realized just now caching wasn't enabled by default. :+1: for making it a default.

@shyam-habarakada

I just upgraded to 0.8.6, and tested this scenario and it was still defaulting to false. I had to explicitly add the following in my RABL init file to get it to turn itself on.

config.cache_sources = !Rails.env.development?

Is this still not fixed?

fyi My Rails.cache is memcached, via dalli and I'm on Rails 3.2

@nesquena
Owner

Patches welcome :) As I mentioned elsewhere, I don't use Rails in my day-to-day at the moment (using Sinatra and Padrino for my web API back-ends) but would be happy to merge in sensible defaults for those using Rails anytime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.