{"id":16389115,"url":"https://github.com/mworrell/filezcache","last_synced_at":"2025-03-21T02:31:48.835Z","repository":{"id":14278147,"uuid":"16986157","full_name":"mworrell/filezcache","owner":"mworrell","description":"File cache for use with cowmachine","archived":false,"fork":false,"pushed_at":"2024-10-02T14:39:39.000Z","size":452,"stargazers_count":4,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-12T04:31:15.488Z","etag":null,"topics":["erlamg","zotonic"],"latest_commit_sha":null,"homepage":"","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/mworrell.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":"2014-02-19T14:09:30.000Z","updated_at":"2024-10-02T14:26:43.000Z","dependencies_parsed_at":"2024-09-13T21:39:00.919Z","dependency_job_id":"56ba3f6c-90be-4d48-9667-76219ca63c5f","html_url":"https://github.com/mworrell/filezcache","commit_stats":{"total_commits":35,"total_committers":3,"mean_commits":"11.666666666666666","dds":0.05714285714285716,"last_synced_commit":"5a934ff815ea5db24316068ff8090e7a2af323fb"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mworrell%2Ffilezcache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mworrell%2Ffilezcache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mworrell%2Ffilezcache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mworrell%2Ffilezcache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mworrell","download_url":"https://codeload.github.com/mworrell/filezcache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221811386,"owners_count":16884305,"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":["erlamg","zotonic"],"created_at":"2024-10-11T04:31:28.560Z","updated_at":"2024-10-28T09:09:49.732Z","avatar_url":"https://github.com/mworrell.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Hex.pm version][hexpm version]][hexpm]\n[![Hex.pm Downloads][hexpm downloads]][hexpm]\n[![Hex.pm Documentation][hexdocs documentation]][hexdocs]\n[![Erlang Versions][erlang version badge]][gh]\n[![License][license]](https://www.apache.org/licenses/LICENSE-2.0)\n\n\nFilezcache - cache s3 and other files on disk\n=============================================\n\nThis is a file caching system optimized for use with cowmachine\nbut can also be used with other services.\n\nIt has some unique properties:\n\n * Lookups return file references (if possible) which can be used with sendfile\n * Cached files can be streamed to requestors while they are being filled\n * On startup the cache is repopulated with existing files\n * Lookups return data formats directly useable for cowmachine serving\n\nThe system uses the file system to store files and a disk log. The files are stored\nin `priv/data/` and the disk log in `priv/journal`.\n\nThe disk log is used to rebuild the cache after a start. Files present on disk but\nnot mentioned in the disk log are deleted.\n\nExample\n-------\n\n    $ ./rebar3 shell\n    ===\u003e Verifying dependencies...\n    ===\u003e Analyzing applications...\n    ===\u003e Compiling filezcache\n    Erlang/OTP 26 [erts-14.2.1] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit]\n    Eshell V14.2.1 (press Ctrl+G to abort, type help(). for help)\n    1\u003e application:ensure_all_started(filezcache).\n    ok\n    2\u003e filezcache:lookup(mykey).\n    {error, enoent}\n    3\u003e filezcache:insert(mykey, \u003c\u003c\"foobar\"\u003e\u003e).\n    {ok,\u003c0.173.0\u003e}.\n    4\u003e filezcache:lookup(mykey).\n    {ok,{file,6,\"priv/data/4J0I2F06043V5P0V603D4O4I6L1J5M1B4I5Y2B2C606W28131H164Z421M4X6221\"}}\n    5\u003e filezcache:insert(mykey, \u003c\u003c\u003e\u003e).\n    {error,{already_started,\u003c0.173.0\u003e}}\n    6\u003e filezcache:delete(mykey).\n    ok\n\n\nConfiguration keys\n------------------\n\n * `max_bytes` Maximum size of the cache in bytes, defaults to 10GiB (10737418240 bytes)\n * `journal_dir` Directory for the disk log, defaults to `priv/journal`\n * `data_dir` Directory for the cached files, defaults to `priv/data`\n\nTODO\n----\n\nThere are some known issues that need to be resolved:\n\n * Add timeouts to `filezcache_entry` states `wait_for_data` and `streaming`\n\n\u003c!-- Badges --\u003e\n[hexpm]: https://hex.pm/packages/filezcache\n[hexpm version]: https://img.shields.io/hexpm/v/filezcache.svg?style=flat-curcle \"Hex version\"\n[hexpm downloads]: https://img.shields.io/hexpm/dt/filezcache.svg?style=flat-curcle\n[hexdocs documentation]: https://img.shields.io/badge/hex-docs-purple.svg?style=flat-curcle\n[hexdocs]: https://hexdocs.pm/filezcache\n[gh]: https://github.com/mworrell/filezcache/actions/workflows/test.yaml\n[erlang version badge]: https://img.shields.io/badge/Supported%20Erlang%2FOTP-22.3%20to%2026-blue.svg?style=flat-curcle\n[license]: https://img.shields.io/badge/License-Apache_2.0-blue.svg?logo=apache\u0026logoColor=red \"Apache 2.0\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmworrell%2Ffilezcache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmworrell%2Ffilezcache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmworrell%2Ffilezcache/lists"}