News for hackers. Stuff that matters.
Re:Show HN: I built a Ruby gem that handles memoization with... by JamesSwift on Tuesday April 22, 2025 @02:54PM (#43765146)
For what its worth, ActiveSupport::CacheStore is a really flexible api that gives minimal contractual obligations (read_entry, write_entry, delete_entry is the entire set of required methods), but still allows you to layer specific functionality (eg TTL) on top with an optional 'options' param. You could get the best of both worlds by adhering to that contract and then people can swap in eg redis cache store if they wanted a network-shared store.

EDIT: see https://github.com/rails/rails/blob/main/activesupport/lib/a...

Re:Show HN: I built a Ruby gem that handles memoization with... by hp_hovercraft84 on Tuesday April 22, 2025 @10:04PM (#43768035)
That's actually a really good idea! I'll definitely consider this in a future update. Thanks!