开发者

Ruby on Rails - global variable persistence across requests

开发者 https://www.devze.com 2023-01-22 09:53 出处:网络
In a RoR application, I wo开发者_如何转开发uld like to load a set of key/values from db into a global variable which persists across requests and clear the variable as and when I need. My application

In a RoR application, I wo开发者_如何转开发uld like to load a set of key/values from db into a global variable which persists across requests and clear the variable as and when I need. My application runs in a WAS cluster. I tried a few things. 1. Used memcachestore and read/write/clear as needed. 2. Load the key/values in a yaml file and clear it when required. Please let me know if I could do it differently.Thanks.


Don't we have flash and session hashes which can store any object we need?

0

精彩评论

暂无评论...
验证码 换一张
取 消