{"id":19049568,"url":"https://github.com/crhntr/httpcache","last_synced_at":"2025-12-15T13:33:02.964Z","repository":{"id":130824763,"uuid":"317694185","full_name":"crhntr/httpcache","owner":"crhntr","description":"A lightweight http cache.","archived":false,"fork":false,"pushed_at":"2020-12-02T00:45:15.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-12-30T19:38:29.453Z","etag":null,"topics":["go","golang","http"],"latest_commit_sha":null,"homepage":"","language":"Go","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/crhntr.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-01T23:23:50.000Z","updated_at":"2020-12-02T00:45:17.000Z","dependencies_parsed_at":"2023-05-18T23:45:13.349Z","dependency_job_id":null,"html_url":"https://github.com/crhntr/httpcache","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crhntr%2Fhttpcache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crhntr%2Fhttpcache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crhntr%2Fhttpcache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crhntr%2Fhttpcache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crhntr","download_url":"https://codeload.github.com/crhntr/httpcache/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232176808,"owners_count":18483779,"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":["go","golang","http"],"created_at":"2024-11-08T23:11:20.127Z","updated_at":"2025-12-15T13:32:57.898Z","avatar_url":"https://github.com/crhntr.png","language":"Go","readme":"# httpcache\n\nExample\n\n```go\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"net/http\"\n\t\"os\"\n\t\"time\"\n\n\t\"github.com/crhntr/httpcache\"\n)\n\nfunc main() {\n\tconst cacheFileName = \"/tmp/http_cache\"\n\tcache := new(httpcache.HTTPCache)\n\tif err := cache.LoadFromFile(cacheFileName); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer func() {\n\t\tif err := cache.SaveToFile(cacheFileName); err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t}()\n\n\thttp.DefaultClient.Transport = cache\n\n\treq, _ := http.NewRequest(http.MethodGet, \"https://crhntr.com/ip\", nil)\n\n\tlast := time.Now()\n\tfor i := 0; i \u003c 10; i++ {\n\t\tres, err := http.DefaultClient.Do(req)\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t\tcontinue\n\t\t}\n\t\t_, _ = io.Copy(os.Stdout, res.Body)\n\t\t_ = res.Body.Close()\n\t\tfmt.Println(time.Since(last), res.StatusCode)\n\t\tlast = time.Now()\n\t}\n}\n\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrhntr%2Fhttpcache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrhntr%2Fhttpcache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrhntr%2Fhttpcache/lists"}