{"id":20309835,"url":"https://github.com/zarqman/smart_cache_store","last_synced_at":"2025-07-20T20:06:41.830Z","repository":{"id":56896181,"uuid":"429511492","full_name":"zarqman/smart_cache_store","owner":"zarqman","description":"Production-ready enhancements for mem_cache_store and redis_cache_store. For Rails or ActiveSupport.","archived":false,"fork":false,"pushed_at":"2023-10-05T22:03:48.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-12T12:51:53.452Z","etag":null,"topics":["memcache","rails","redis"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zarqman.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-18T17:00:07.000Z","updated_at":"2021-11-18T17:04:13.000Z","dependencies_parsed_at":"2024-11-14T17:42:02.354Z","dependency_job_id":null,"html_url":"https://github.com/zarqman/smart_cache_store","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/zarqman/smart_cache_store","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zarqman%2Fsmart_cache_store","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zarqman%2Fsmart_cache_store/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zarqman%2Fsmart_cache_store/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zarqman%2Fsmart_cache_store/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zarqman","download_url":"https://codeload.github.com/zarqman/smart_cache_store/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zarqman%2Fsmart_cache_store/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265365682,"owners_count":23753378,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["memcache","rails","redis"],"created_at":"2024-11-14T17:28:53.468Z","updated_at":"2025-07-20T20:06:41.815Z","avatar_url":"https://github.com/zarqman.png","language":"Ruby","readme":"# SmartCacheStore\n\nSmartCacheStore provides variations on ActiveSupport's MemCacheStore and RedisCacheStore to make the default configurations more production ready. It does this by setting better defaults and using a few more ENVs.\n\n\n##### Redis -- SmartRedisCache\n\nSet by default:\n\n    url:                ENV['REDIS_URL']\n    namespace:          ENV['REDIS_NAMESPACE']\n    expires_in:         1.day\n    race_condition_ttl: 5.seconds\n    pool:               ENV['RAILS_MAX_THREADS'] || 5\n    connect_timeout:    2\n    read_timeout:       1\n    write_timeout:      1\n    reconnect_attempts: [0.2]\n\n`:url` should be a uri, like: `redis://localhost:6379/0`. For two or more uris, combine with a comma: `redis://host-a,redis://host-b`.\n\nAny of these may still be specified directly, as well as all other support parameters for RedisCacheStore or the Redis gem.\n\n\n##### Memcache -- SmartMemCache\n\nSet by default:\n\n    url:                ENV['MEMCACHE_SERVERS']\n    namespace:          ENV['MEMCACHE_NAMESPACE']\n    expires_in:         1.day\n    race_condition_ttl: 5.seconds\n    failover:           true\n    pool:               ENV['RAILS_MAX_THREADS'] || 5\n\nMemCacheStore's legacy initializer with `*addresses` as the first parameter, and the RedisCacheStore compatible `:url` are supported.\n\n`:url` or *addresses should be a uri, like: `memcached://localhost:11211`. For two or more uris, combine with a comma: `memcached://host-a,memcached://host-b`.\n\n\n### Other features\n\nSmartMemCache's increment() and decrement() are also enhanced to be able to act on previously unset keys.\n\n\n## Usage\n\nIn `environment/[env].rb`:\n\n#### Redis\n\n    # basic:\n    config.cache_store = :smart_redis_cache\n    # with parameters:\n    config.cache_store = :smart_redis_cache, {url: 'redis://localhost:1234/9'}\n\n#### Memcache\n\n    # basic:\n    config.cache_store = :smart_mem_cache\n    # with parameters:\n    config.cache_store = :smart_mem_cache, 'memcached://localhost:1234'\n    config.cache_store = :smart_mem_cache, 'memcached://localhost:1234', {expires_in: 1.hour}\n    config.cache_store = :smart_mem_cache, {url: 'memcached://localhost:1234', expires_in: 1.hour}\n\n\n\n## Installation\nAdd `smart_cache_store` plus one driver to your application's Gemfile:\n\n```ruby\ngem 'redis' # for redis; gem v4.x or 5.x\n# OR\ngem 'dalli' # for memcache\n\ngem \"smart_cache_store\"\n```\n\nAnd then execute:\n```bash\n$ bundle\n```\n\n\n## Contributing\n\n1. Fork it ( https://github.com/zarqman/smart_cache_store/fork )\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n## License\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzarqman%2Fsmart_cache_store","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzarqman%2Fsmart_cache_store","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzarqman%2Fsmart_cache_store/lists"}