{"id":16062114,"url":"https://github.com/rossta/cache_cow","last_synced_at":"2025-02-23T01:15:52.400Z","repository":{"id":66515658,"uuid":"2651211","full_name":"rossta/cache_cow","owner":"rossta","description":"Rails cache extensions for models","archived":false,"fork":false,"pushed_at":"2011-10-27T11:54:32.000Z","size":128,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-03T04:38:02.933Z","etag":null,"topics":[],"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/rossta.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-10-26T14:03:36.000Z","updated_at":"2013-06-28T10:47:51.000Z","dependencies_parsed_at":"2023-02-20T05:45:36.643Z","dependency_job_id":null,"html_url":"https://github.com/rossta/cache_cow","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rossta%2Fcache_cow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rossta%2Fcache_cow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rossta%2Fcache_cow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rossta%2Fcache_cow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rossta","download_url":"https://codeload.github.com/rossta/cache_cow/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232417214,"owners_count":18519674,"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-10-09T04:21:57.787Z","updated_at":"2025-01-04T02:28:26.840Z","avatar_url":"https://github.com/rossta.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CacheCow\n\nCacheCow allows ActiveRecord models to `acts_as_cached``\n\n\n## Install\n\nIn your Gemfile\n\n    gem \"cache_cow\"\n\nOr via command line\n\n    gem install cache_cow\n\n\n## Overview\n\nCacheCow provides an api for caching results of methods and associations on ActiveRecord models.\n\nTo use in a model, declare `acts_as_cached`\n\n``` ruby\nclass Post\n  acts_as_cached\nend\n```\n\nInstances of a cache_cow model can read, write, fetch, and expire their own cache keys. Cache keys\nare namespaced and versioned by convention as \u003cclass_name\u003e:\u003cversion\u003e:\u003cid\u003e:\u003ccache_suffix\u003e. An instances\nid is the cache suffix be default.\n\n``` ruby\n# Post.cache_cow_version = 1\n\npost = Post.find(123)\n\npost.fetch_cache { \"great post\" }     # fetches from cache key 'Post:1:123', store 'great post' on cache miss\n\npost.write_cache(\"foo\", \"bar\")        # writes 'bar to cache key 'Post:1:123:foo'\n\npost.read_cache(\"foo\")                # returns 'bar' from cache key 'Post:1:123:foo'\n````\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frossta%2Fcache_cow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frossta%2Fcache_cow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frossta%2Fcache_cow/lists"}