{"id":19007071,"url":"https://github.com/happy-san/dart-cacher","last_synced_at":"2025-09-06T12:31:54.174Z","repository":{"id":62772847,"uuid":"562363059","full_name":"happy-san/dart-cacher","owner":"happy-san","description":"Implementations of common cache replacement algorithms in Dart.","archived":false,"fork":false,"pushed_at":"2023-11-05T09:43:51.000Z","size":63,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"trunk","last_synced_at":"2025-04-07T03:22:18.579Z","etag":null,"topics":["cache","dart","lfu-cache","lru-cache","tlru-cache"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/cacher","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/happy-san.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2022-11-06T05:15:29.000Z","updated_at":"2024-08-16T12:25:29.000Z","dependencies_parsed_at":"2023-01-22T10:00:15.852Z","dependency_job_id":"192c5116-ad21-45ba-b323-c0807b598f1e","html_url":"https://github.com/happy-san/dart-cacher","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/happy-san/dart-cacher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/happy-san%2Fdart-cacher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/happy-san%2Fdart-cacher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/happy-san%2Fdart-cacher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/happy-san%2Fdart-cacher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/happy-san","download_url":"https://codeload.github.com/happy-san/dart-cacher/tar.gz/refs/heads/trunk","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/happy-san%2Fdart-cacher/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273904849,"owners_count":25188633,"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-09-06T02:00:13.247Z","response_time":2576,"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":["cache","dart","lfu-cache","lru-cache","tlru-cache"],"created_at":"2024-11-08T18:36:01.467Z","updated_at":"2025-09-06T12:31:53.846Z","avatar_url":"https://github.com/happy-san.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e This is a modification of https://github.com/platelk/dcache, licensed under the MIT License.\n\n# Cacher\n\nCacher is a simple library to implement application caching in `dart` inspired by [gcache](https://github.com/bluele/gcache)\n\n## Features\n\n* Supports expirable Cache, [Least Frequently Used](https://en.wikipedia.org/wiki/Least_frequently_used), [Least recently used](https://en.wikipedia.org/wiki/Cache_replacement_policies#LRU), [Time aware least recently used](https://en.wikipedia.org/wiki/Cache_replacement_policies#Time_aware_least_recently_used_(TLRU)).\n* Supports eviction.\n* Async loading of expired value.\n* Automatically load cache if it doesn't exists. (Optional)\n* Callback for evicted items to perform cleanup (Optional)\n\n## Example\n\n### Simple use case\n\n```dart\nimport 'package:cacher/cacher.dart';\n\nvoid main() {\n  Cache c = SimpleCache(storage: SimpleStorage(20));\n\n  c.set(\"key\", 42);\n  print(c.get(\"key\")); // 42\n  print(c.containsKey(\"unknown_key\")); // false\n  print(c.get(\"unknown_key\")); // null\n}\n```\n\n### Add logic on eviction.\n\n```dart\nimport 'package:cacher/cacher.dart';\n\nvoid main() {\n  Cache c = SimpleCache\u003cKey, Disposable\u003e(\n      storage: SimpleStorage(20),\n      onEvict: (key, value) {\n        value.dispose();\n      });\n}\n```\n\n### Loading function\n\n```dart\nimport 'package:cacher/cacher.dart';\n\nvoid main() {\n  Cache c = SimpleCache\u003cint, int\u003e(\n    storage: SimpleStorage(20),\n  )..loader = (key, oldValue) =\u003e key * 10;\n\n  print(c.get(4)); // 40\n  print(c.get(5)); // 50\n  print(c.containsKey(6)); // false\n}\n```\n\n## Authors\n\n*Kevin PLATEL*\n\n* mail : \u003cplatel.kevin@gmail.com\u003e\n* github : \u003chttps://github.com/platelk\u003e\n* twitter : \u003chttps://twitter.com/kevinplatel\u003e\n\n*Harpreet Sangar*\n\n* mail : \u003chappy_san@protonmail.com\u003e\n* github : \u003chttps://github.com/happy-san\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhappy-san%2Fdart-cacher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhappy-san%2Fdart-cacher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhappy-san%2Fdart-cacher/lists"}