{"id":15491101,"url":"https://github.com/rodydavis/http_get_cache","last_synced_at":"2025-04-22T19:11:15.638Z","repository":{"id":249155353,"uuid":"830623419","full_name":"rodydavis/http_get_cache","owner":"rodydavis","description":"HTTP compliant cache for Dart and Flutter. This package is a wrapper around the http package that provides a simple way to cache responses using the 'Cache-Control', 'eTag' and 'Last-Modified' headers.","archived":false,"fork":false,"pushed_at":"2024-11-26T08:44:16.000Z","size":2055,"stargazers_count":23,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-18T17:30:39.598Z","etag":null,"topics":["cache-control","dart","flutter","http"],"latest_commit_sha":null,"homepage":"","language":"Dart","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/rodydavis.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":"2024-07-18T16:23:43.000Z","updated_at":"2025-04-01T12:41:21.000Z","dependencies_parsed_at":"2024-07-19T16:52:28.615Z","dependency_job_id":"9b22521a-4c15-4ac5-96c6-15baec7ab029","html_url":"https://github.com/rodydavis/http_get_cache","commit_stats":null,"previous_names":["rodydavis/flutter_http_cache","rodydavis/http_get_cache"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodydavis%2Fhttp_get_cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodydavis%2Fhttp_get_cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodydavis%2Fhttp_get_cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodydavis%2Fhttp_get_cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rodydavis","download_url":"https://codeload.github.com/rodydavis/http_get_cache/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250306638,"owners_count":21408926,"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":["cache-control","dart","flutter","http"],"created_at":"2024-10-02T07:43:35.156Z","updated_at":"2025-04-22T19:11:15.622Z","avatar_url":"https://github.com/rodydavis.png","language":"Dart","readme":"# http_get_cache\n\nHTTP compliant cache for Flutter. This package is a wrapper around the `http` package that provides a simple way to cache responses using the 'Cache-Control', 'eTag' and 'Last-Modified' headers.\n\n## Dart\n\n```dart\nimport 'package:http_get_cache/http_get_cache.dart';\n\nvoid main() async {\n    ...\n    await initHttpGetCache(cachePath: '.cache', databasePath: '.db');\n\n    // Create a new HTTP Client\n    final client = httpClient();\n\n    // Future\u003cStreamedResponse\u003e\n    final res = await client.send('...');\n\n    // Stream\u003cStreamedResponse\u003e\n    final res = await client.stream('...');\n}\n```\n\n## Flutter\n\nIn the `main.dart` file you can add the following code:\n\n```dart\nimport 'package:http_get_cache/http_get_cache_flutter.dart';\n\nvoid main() async {\n    ...\n    await initFlutterHttpGetCache();\n    \n    // Create a new HTTP Client\n    final client = httpClient();\n\n    // Future\u003cStreamedResponse\u003e\n    final res = await client.send('...');\n    \n    // Stream\u003cStreamedResponse\u003e\n    final res = await client.stream('...');\n}\n```\n\nWhen building the Flutter app you can remove the default client with the following variable:\n\n```\n--dart-define=no_default_http_client=true\n```\n\n## Wrap with RetryClient\n\n```dart\nimport 'package:http/retry.dart';\n\nfinal client = RetryClient(httpClient());\n```\n\n## Install via git:\n\n```yaml\nhttp_get_cache:\n    git:\n      url: https://github.com/rodydavis/http_get_cache\n```\n\n## See also\n\n- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control\n- https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching\n- https://www.mnot.net/cache_docs/\n- https://jakearchibald.com/2016/caching-best-practices/\n- https://csswizardry.com/2019/03/cache-control-for-civilians/\n- https://httpwg.org/specs/rfc9111.html\n- https://httpwg.org/specs/rfc5861.html\n- https://httpwg.org/specs/rfc8246.html\n","funding_links":[],"categories":["Dart"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frodydavis%2Fhttp_get_cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frodydavis%2Fhttp_get_cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frodydavis%2Fhttp_get_cache/lists"}