{"id":17790933,"url":"https://github.com/cubicdaiya/cachectl","last_synced_at":"2025-03-16T14:31:27.091Z","repository":{"id":24980004,"uuid":"28398436","full_name":"cubicdaiya/cachectl","owner":"cubicdaiya","description":"Page cache controller for regular file in Go","archived":false,"fork":false,"pushed_at":"2023-03-07T02:28:43.000Z","size":70,"stargazers_count":104,"open_issues_count":0,"forks_count":13,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-16T03:22:28.932Z","etag":null,"topics":["daemon","posix-fadvise"],"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/cubicdaiya.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-12-23T13:04:53.000Z","updated_at":"2025-02-26T12:12:08.000Z","dependencies_parsed_at":"2024-06-20T04:28:14.048Z","dependency_job_id":"b7614a87-d450-4bd4-a9c8-f41a84eaff0f","html_url":"https://github.com/cubicdaiya/cachectl","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cubicdaiya%2Fcachectl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cubicdaiya%2Fcachectl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cubicdaiya%2Fcachectl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cubicdaiya%2Fcachectl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cubicdaiya","download_url":"https://codeload.github.com/cubicdaiya/cachectl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243882532,"owners_count":20363152,"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":["daemon","posix-fadvise"],"created_at":"2024-10-27T10:48:31.573Z","updated_at":"2025-03-16T14:31:26.486Z","avatar_url":"https://github.com/cubicdaiya.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cachectl\n\n`cachectl` is a controller for regular file's page cache. \n\n## Dependency\n\n`posix_fadvise` is required.\n\n## Installation\n\n```\ngo get -u github.com/cubicdaiya/cachectl/...\n```\n\nIf you don't have go-runtime, you may download the binary from [here](https://github.com/cubicdaiya/cachectl/releases).\n\n## Show page cache stat for file\n\n```\ncachectl -f /var/log/access_log\n```\n\n## Purge page cache for file\n\n```\ncachectl -op purge -f /var/log/access_log\n```\n\nIf you want to leave a cache appended recently, assigning a rate for purging page cache with `-r` is recommended.\n\n```\ncachectl -op purge -f /var/log/access_log -r 0.9\n```\n\n# cachectld\n\n`cachectld` is a daemon for scheduled purging page cache. Its behavior is described by [TOML](https://github.com/toml-lang/toml).\n\n```\ncachectld -c conf/cachectld.toml\n```\n\n## Configuration for cachectld\n\nA configuration for `cachectld` has one or multiple targets.\n\n|name          |type  |description                                  |default|note                                             |\n|--------------|------|---------------------------------------------|-------|-------------------------------------------------|\n|path          |string|target file path                             |       |directory or file path                           |\n|purge_interval|int   |interval for purging page cache for file     |3600   |unit is second. if -1 is set, purge does not run.|\n|filter        |string|filtering pattern string for target file path|.*     |regular expression with golang's regexp package  |\n|rate          |float |rate of purging page cache for file          |0.0    |0.0 and 1.0 is same behavior (0.0 \u003c= rate \u003c= 1.0)|\n\nA example is below.\n\n```toml\n[[targets]]\npath = \"/vagrant/cachectl.go\"\npurge_interval = 30\n\n[[targets]]\npath = \"/vagrant/cachectld.go\"\npurge_interval = 20\n\n[[targets]]\npath = \"/vagrant/cachectl\"\npurge_interval = 5\nfilter = \"\\\\.go$\"\nrate = 0.9\n```\n\n## Signal trigger\n\nFrom `v0.3.0`, you can trigger with `SIGUSR1` to run the targets for `cachectld`.\n\n```\n$ pkill -USR1 cachectld\n```\n\nWhen `SIGUSR1` is received, `cachectld` runs all targets including the targets `purge_interval` is set -1.\n\n## License\n\nCopyright 2014-2016 Tatsuhiko Kubo\n\n\nLicensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcubicdaiya%2Fcachectl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcubicdaiya%2Fcachectl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcubicdaiya%2Fcachectl/lists"}