Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- config.middleware.use PerRequestCache
- PerRequestCache.fetch(:foo_cache){ some_expensive_foo }
- class MyCacher
- def self.result
- @@result ||= begin
- # do expensive stuff
- # and cache in @@result
- end
- end
- end
- MyCacher.result
Add Comment
Please, Sign In to add comment