{"id":15724454,"url":"https://github.com/cldellow/url-cache","last_synced_at":"2025-10-14T04:24:57.889Z","repository":{"id":140791557,"uuid":"174748859","full_name":"cldellow/url-cache","owner":"cldellow","description":"Read a URL from the Internet, fetching from local cache if available.","archived":false,"fork":false,"pushed_at":"2019-03-09T22:10:11.000Z","size":13,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T12:13:21.004Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cldellow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2019-03-09T21:36:30.000Z","updated_at":"2019-03-09T22:10:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"e1751520-3758-4660-b1f1-d660184573a1","html_url":"https://github.com/cldellow/url-cache","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/cldellow%2Furl-cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cldellow%2Furl-cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cldellow%2Furl-cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cldellow%2Furl-cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cldellow","download_url":"https://codeload.github.com/cldellow/url-cache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246399798,"owners_count":20770908,"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-03T22:16:43.903Z","updated_at":"2025-10-14T04:24:52.870Z","avatar_url":"https://github.com/cldellow.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# url-cache\n\nRead a file from the Internet, unless we've already fetched it,\nin which case, read it from the local cache.\n\nThis is minimalist. Known issues:\n\n- Doesn't do connection pooling\n- Multiple requests for the same file from different threads may race\n  and result in a corrupt file\n- The naming schema for `fetchNamed` can result in conflicts\n\n...in other words, it's not bullet proof. But it's probably suitable\nfor most purposes.\n\n```scala\nimport com.cldellow.urlcache.Cache\n\n// Caches to /tmp/cache/d6/57/d657127c40d4ecfe29c74c366b3198bd\nCache.fetch(\"https://google.com/robots.txt\")\n\n// Caches to /tmp/mydir/d6/57/d657127c40d4ecfe29c74c366b3198bd\nnew Cache(\"/tmp/mydir\").fetch(\"https://google.com/robots.txt\")\n\n// Cache in /tmp/cache/mydir/d6/57/d657127c40d4ecfe29c74c366b3198bd\nCache.fetch(\"https://google.com/robots.txt\", prefix = \"mydir\"))\n\n// Cache to /tmp/cache/misc/https_google.com_robots.txt\nCache.fetchNamed(\"https://google.com/robots.txt\")\n\n// Cache first 100 bytes to /tmp/cache/d6/57/d657127c40d4ecfe29c74c366b3198bd-0-100\nCache.fetch(\"https://google.com/robots.txt\", range = (0, 100))\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcldellow%2Furl-cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcldellow%2Furl-cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcldellow%2Furl-cache/lists"}