{"id":13582032,"url":"https://github.com/femiwiki/caddy-mwcache","last_synced_at":"2025-03-20T22:31:44.822Z","repository":{"id":40433071,"uuid":"327468187","full_name":"femiwiki/caddy-mwcache","owner":"femiwiki","description":":wrench: Caddy anonymous cache plugin for MediaWiki","archived":false,"fork":false,"pushed_at":"2024-04-19T13:15:23.000Z","size":355,"stargazers_count":5,"open_issues_count":6,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-18T01:59:30.337Z","etag":null,"topics":["cache","caddy","caddy-module","caddy-plugin","caddy2","mediawiki","plugin"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/femiwiki.png","metadata":{"funding":{"patreon":"femiwiki"},"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":"2021-01-07T01:10:10.000Z","updated_at":"2023-09-10T15:34:25.000Z","dependencies_parsed_at":"2023-12-19T04:46:16.699Z","dependency_job_id":"909c1d51-13b2-4979-89a9-49453b90c5ca","html_url":"https://github.com/femiwiki/caddy-mwcache","commit_stats":{"total_commits":101,"total_committers":3,"mean_commits":"33.666666666666664","dds":0.4356435643564357,"last_synced_commit":"26f9518532622787aea757ec35db7899e0eda101"},"previous_names":["femiwiki/caddy-wmcache"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/femiwiki%2Fcaddy-mwcache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/femiwiki%2Fcaddy-mwcache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/femiwiki%2Fcaddy-mwcache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/femiwiki%2Fcaddy-mwcache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/femiwiki","download_url":"https://codeload.github.com/femiwiki/caddy-mwcache/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244085023,"owners_count":20395523,"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","caddy","caddy-module","caddy-plugin","caddy2","mediawiki","plugin"],"created_at":"2024-08-01T15:02:23.761Z","updated_at":"2025-03-20T22:31:44.486Z","avatar_url":"https://github.com/femiwiki.png","language":"Go","funding_links":["https://patreon.com/femiwiki"],"categories":["Go"],"sub_categories":[],"readme":"caddy-mwcache\n========\n[![go doc badge]][go doc link]\n[![Github checks status]][github checks link]\n[![codecov.io status]][codecov.io link]\n\ncaddy-mwcache is a cache plugin for [MediaWiki].\n\n### Usage\n```caddyfile\nexample.com {\n    mwcache\n}\n```\n\nCurrently, only \"ristretto\" backend is supported and used by default.\n\n```caddyfile\n# Default value\nmwcache {\n    ristretto\n    purge_acl 127.0.0.1\n}\n```\n\n- **ristretto** is also used as a block to configure backend. Configuration keys\n  are snake case versions of fields of [Ristretto's Config struct]. But it is\n  limited to only primitive types(bool, int, string, etc).\n- **purge_acl** is either a single item or a list of CIDRs or IP addresses that\n  are allowed to request to purge cache.\n\n```caddyfile\nmwcache {\n    ristretto {\n        num_counters \u003cvalue\u003e\n        max_cost \u003cvalue\u003e\n        buffer_items \u003cvalue\u003e\n        \u003cadditional config key1\u003e \u003cvalue1\u003e\n        \u003cadditional config key2\u003e \u003cvalue2\u003e\n    }\n    purge_acl {\n        \u003ccidr1\u003e\n        \u003ccidr2\u003e\n        \u003caddress1\u003e\n        \u003caddress2\u003e\n    }\n}\n```\n\n### Configuring MediaWiki\n\u003e **WARNING**: If you are using php-curl extension with curl ≥7.62, you cannot\n\u003e use this plugin due to MediaWiki's bug [T264735].\n\nYou must add the next lines your [LocalSettings.php].\n\n```php\n// LocalSettings.php\n$wgUseCdn = true;\n$wgCdnServers = '127.0.0.1';\n// If your web server supports TLS\n$wgInternalServer = 'http://127.0.0.1';\n```\n\n### Build\nPrerequisites:\n\n- Go\n- [xcaddy]\n\n```bash\n# Run the program right away\nxcaddy\nxcaddy version\nxcaddy list-modules\n\n# Build the binary, \"./caddy\" is the output\nxcaddy build \\\n  --with github.com/femiwiki/caddy-mwcache\n```\n\n### Development\nUse [docker-compose] to setup test environment.\n\n```bash\n# Start a php-fpm server\ndocker-compose --project-directory example up --detach\n# Start a web server\ndocker-compose --project-directory example exec --workdir=/root/src caddy xcaddy start --config example/Caddyfile\n# Or detach by run command\n# docker-compose --project-directory example exec --workdir=/root/src caddy xcaddy run --config example/Caddyfile\n\n# Test\ncurl -so /dev/null -w \"%{time_total}\\n\" 'http://127.0.0.1:2015'\ncurl -so /dev/null -w \"%{time_total}\\n\" 'http://127.0.0.1:2015/slow.php'\ncurl -so /dev/null -w \"%{time_total}\\n\" 'http://127.0.0.1:2015/slow.php'\n\n# Reload Caddyfile\ndocker-compose --project-directory example exec --workdir=/root/src caddy xcaddy reload --config example/Caddyfile\n\n# Stop the web server\ndocker-compose --project-directory example exec --workdir=/root/src caddy xcaddy stop\n\n# Stop the all services\ndocker-compose --project-directory example down\n```\n\n\u0026nbsp;\n\n--------\n\nThe source code of *femiwiki/caddy-mwcache* is primarily distributed under the\nterms of the [GNU Affero General Public License v3.0] or any later version. See\n[COPYRIGHT] for details.\n\n[go doc badge]: https://img.shields.io/badge/godoc-reference-blue.svg\n[go doc link]: http://godoc.org/github.com/femiwiki/caddy-mwcache\n[github checks status]: https://badgen.net/github/checks/femiwiki/caddy-mwcache\n[github checks link]: https://github.com/femiwiki/caddy-mwcache/actions\n[codecov.io status]: https://badgen.net/codecov/c/github/femiwiki/caddy-mwcache\n[codecov.io link]: https://codecov.io/gh/femiwiki/caddy-mwcache\n\n[mediawiki]: https://www.mediawiki.org\n[Ristretto's Config struct]: https://pkg.go.dev/github.com/dgraph-io/ristretto#Config\n[T264735]: https://phabricator.wikimedia.org/T264735\n[localsettings.php]: https://www.mediawiki.org/wiki/Manual:LocalSettings.php\n[xcaddy]: https://github.com/caddyserver/xcaddy\n[docker-compose]: https://docs.docker.com/compose/\n\n[GNU Affero General Public License v3.0]: LICENSE\n[COPYRIGHT]: COPYRIGHT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffemiwiki%2Fcaddy-mwcache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffemiwiki%2Fcaddy-mwcache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffemiwiki%2Fcaddy-mwcache/lists"}