gonzoyumo
gonzoyumo

Reputation: 349

Rails 4 : What is cached when using config.cache_classes = true

I was just wondering and didn't find explicit response on what in the model class (ActiveRecord) is cached when setting config.cache_classes to true ?

Could someone tell me or point me to the doc I didn't found ?

Thanks

Upvotes: 22

Views: 12705

Answers (2)

Gupta
Gupta

Reputation: 10398

What is cached when using config.cache_classes = true

It responsible for two thing in rails 4

1. It prevent class reloading between requests.

2. It ensure Rack::Lock in not included in middleware stack, so that your thread don't get locked.

Upvotes: 0

x1a4
x1a4

Reputation: 19496

It determines whether or not your application classes are reloaded on each request. If it's true, you have to restart your server for code changes to take effect (i.e. you set it to true in production, false in development.)

Documentation is here.

Upvotes: 23

Related Questions