Patch #8222

Setting model should use Rails.cache instead of class variable

Added by Jan from Planio www.plan.io about 2 years ago. Updated almost 2 years ago.

Status:NewStart date:2011-04-25
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Rails support
Target version:Candidate for next major release

Description

The Setting model uses two local class variables called @cached_settings and @cached_cleared_on to prevent reloading the settings from database and/or settings.yml at every request.

Rails has been supporting different cache implementations for some time now, why not let the Setting model use them as well? Besides the fact that this will help with tenant switching which we've implemented for Planio, it should also improve Redmine's performance when running it with more than processes and a custom cache mechanism, like memcached.

A patch is attached.

setting_rb_use_rails_cache.patch Magnifier (1.67 KB) Jan from Planio www.plan.io, 2011-04-25 19:44

rails-cache.diff Magnifier (9.87 KB) Toshi MARUYAMA, 2011-05-28 10:16

History

#1 Updated by Etienne Massip about 2 years ago

  • Target version set to Candidate for next major release

#2 Updated by Anuj Sapkota about 2 years ago

  • Status changed from New to Resolved
  • Assignee set to Jim Mulholland

dsadaasdsadasdasdadasd

#3 Updated by Jan from Planio www.plan.io about 2 years ago

?? :-)

how were you even able to update this ticket?

#4 Updated by Etienne Massip about 2 years ago

  • Status changed from Resolved to New
  • Assignee deleted (Jim Mulholland)

#5 Updated by Toshi MARUYAMA almost 2 years ago

This is patch series from https://www.chiliproject.org/issues/350

#6 Updated by Etienne Massip almost 2 years ago

Chiliproject looks to add a lot of code complexity and we should not need to change tests, Jan's patch, on the other side, is pretty clean.

Should settings be cached separately or could the full Hash of Settings be cached instead ?

Also available in: Atom PDF