For a caching mechanism for my Rails app I am setting a class variable in an instance method which is then later accessed in a class method. This works, but I’m a bit paranoid that there could be a memory leak. Therefore does anyone know if Rails @@class variables are cleared between requests? I have tried this out (on my local development environment), but you never know.
Share
They dont get cleared if you have
config.cache_classes = true, which is generally the case in production.