{"id":23744959,"url":"https://github.com/wheeyls/cached_key_value_store","last_synced_at":"2025-09-04T19:32:17.900Z","repository":{"id":8642268,"uuid":"10291386","full_name":"wheeyls/cached_key_value_store","owner":"wheeyls","description":null,"archived":false,"fork":false,"pushed_at":"2013-06-04T18:15:13.000Z","size":148,"stargazers_count":14,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-19T11:19:31.531Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/wheeyls.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-05-25T23:48:53.000Z","updated_at":"2021-11-04T20:57:25.000Z","dependencies_parsed_at":"2022-08-22T22:31:25.826Z","dependency_job_id":null,"html_url":"https://github.com/wheeyls/cached_key_value_store","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wheeyls%2Fcached_key_value_store","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wheeyls%2Fcached_key_value_store/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wheeyls%2Fcached_key_value_store/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wheeyls%2Fcached_key_value_store/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wheeyls","download_url":"https://codeload.github.com/wheeyls/cached_key_value_store/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231987772,"owners_count":18456475,"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":[],"created_at":"2024-12-31T12:51:24.062Z","updated_at":"2024-12-31T12:51:24.619Z","avatar_url":"https://github.com/wheeyls.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CachedKeyValueStore\n\nSending redis a request for each of those thousands of translations scattered\nthroughout your app is slow. This gem memoizes those requests, and sets up a\nsimple mechanism to bust the cache.\n\nIf you want to use Redis for I18n, I recommend you watch\n[this railscast](http://railscasts.com/episodes/256-i18n-backends),\nand use this backend instead of the KeyValue one that he uses.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'cached_key_value_store'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install cached_key_value_store\n\n## Usage\n\nIn your initializer:\n\n    I18n.backend = I18n::Backend::CachedKeyValueStore.new($redis)\n\n### Busting the Cache\n\nThe ```#ensure_freshness!``` method can be called periodically to make sure\nthat new changes show up. I put mine in a before filter:\n\n    class ApplicationController \u003c ActionController::Base\n      before_filter :ensure_fresh_i18n\n\n      private\n      def ensure_fresh_i18n\n        I18n.backend.ensure_freshness! I18n.locale\n      end\n    end\n\nYou can also call ```#update_version!(locale)``` yourself to signal that the\ntranslations have been modified.\n\nThe ```on_update_version``` hook will be triggered every time the version is\nupdated.\n\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Added some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwheeyls%2Fcached_key_value_store","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwheeyls%2Fcached_key_value_store","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwheeyls%2Fcached_key_value_store/lists"}