{"id":16389313,"url":"https://github.com/marcelog/simple_cache","last_synced_at":"2025-08-13T19:44:42.008Z","repository":{"id":7269440,"uuid":"8582591","full_name":"marcelog/simple_cache","owner":"marcelog","description":"Small erlang simple cache using ETS to wrap your methods with","archived":false,"fork":false,"pushed_at":"2014-08-08T11:06:34.000Z","size":288,"stargazers_count":18,"open_issues_count":1,"forks_count":26,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-04T12:35:55.159Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marcelog.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-03-05T15:25:50.000Z","updated_at":"2018-04-09T18:25:40.000Z","dependencies_parsed_at":"2022-08-28T13:20:59.302Z","dependency_job_id":null,"html_url":"https://github.com/marcelog/simple_cache","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/marcelog/simple_cache","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelog%2Fsimple_cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelog%2Fsimple_cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelog%2Fsimple_cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelog%2Fsimple_cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcelog","download_url":"https://codeload.github.com/marcelog/simple_cache/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelog%2Fsimple_cache/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270303523,"owners_count":24562070,"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","status":"online","status_checked_at":"2025-08-13T02:00:09.904Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-11T04:32:20.223Z","updated_at":"2025-08-13T19:44:41.946Z","avatar_url":"https://github.com/marcelog.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Introduction\n\nThis is the source code for [this post](http://inaka.net/blog/2013/03/05/ETS-simple-cache/), a\nsimple ETS based cache.\n\nFor the original version, see the [0.1 tag](https://github.com/marcelog/simple_cache/tree/0.1)\n\n# Using it\n\nThe updated code now has a separate process to handle the expirations, which is\na regular gen_server. To start it, just do:\n\n    simple_cache_expirer:start_link()\n\n## Create a cache\n\n    simple_cache:init(my_cache_name).\n\n## Getting a key\n\nThe following call will lookup **my\\_key** in the cache named **my\\_cache\\_name**, and on\na MISS will call the given **fun**, caching its result for **3600000** milliseconds.\n\n    simple_cache:get(my_cache_name, 3600000, my_key, fun() -\u003e\n        io:format(\"This fun will be called on a cache miss~n\"),\n        timer:sleep(5000)\n        this_value_will_be_cached\n    end)\n\n## Flushing the cache\n\n    simple_cache:flush(my_cache_name).\n\n## Flushing a key\n\n    simple_cache:flush(my_cache_name, my_key).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcelog%2Fsimple_cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcelog%2Fsimple_cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcelog%2Fsimple_cache/lists"}