{"id":18550289,"url":"https://github.com/xp-forge/web-compression","last_synced_at":"2025-08-07T15:10:46.920Z","repository":{"id":241919143,"uuid":"808212980","full_name":"xp-forge/web-compression","owner":"xp-forge","description":"Web compression","archived":false,"fork":false,"pushed_at":"2024-05-30T15:53:40.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-15T10:08:53.255Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/xp-forge.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","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":"2024-05-30T15:51:55.000Z","updated_at":"2024-05-30T15:53:42.000Z","dependencies_parsed_at":"2024-05-30T18:57:55.667Z","dependency_job_id":"6786a4c2-ad44-44e9-8ea3-5a8c7854b225","html_url":"https://github.com/xp-forge/web-compression","commit_stats":null,"previous_names":["xp-forge/web-compression"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xp-forge/web-compression","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-forge%2Fweb-compression","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-forge%2Fweb-compression/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-forge%2Fweb-compression/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-forge%2Fweb-compression/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xp-forge","download_url":"https://codeload.github.com/xp-forge/web-compression/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-forge%2Fweb-compression/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264569440,"owners_count":23629601,"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-11-06T21:04:07.187Z","updated_at":"2025-07-10T11:08:32.216Z","avatar_url":"https://github.com/xp-forge.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Web compression\n===============\n\n[![Build status on GitHub](https://github.com/xp-forge/web-compression/workflows/Tests/badge.svg)](https://github.com/xp-forge/web-compression/actions)\n[![XP Framework Module](https://raw.githubusercontent.com/xp-framework/web/master/static/xp-framework-badge.png)](https://github.com/xp-framework/core)\n[![BSD Licence](https://raw.githubusercontent.com/xp-framework/web/master/static/licence-bsd.png)](https://github.com/xp-framework/core/blob/master/LICENCE.md)\n[![Requires PHP 7.4+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-7_4plus.svg)](http://php.net/)\n[![Supports PHP 8.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-8_0plus.svg)](http://php.net/)\n[![Latest Stable Version](https://poser.pugx.org/xp-forge/web-compression/version.png)](https://packagist.org/packages/xp-forge/web-compression)\n\n[HTTP compression](https://developer.mozilla.org/en-US/docs/Web/HTTP/Compression) for the XP Framework, implemented as filter.\n\nExample\n-------\nThe following shows how to enable on-the-fly compression for HTTP responses. Depending on the *Accept-Encoding* header the client sends, the server-supported compression algorithms and the length of the content, the response is compressed, saving bandwidth.\n\n```php\nuse web\\{Application, Filters};\nuse web\\filters\\CompressResponses;\n\nclass Service extends Application {\n\n  public function routes() {\n    return new Filters([new CompressResponses()], function($req, $res) {\n      $content= /* ... */;\n\n      $res-\u003eanswer(200);\n      $res-\u003esend($content, 'text/html; charset=utf-8');\n    });\n  }\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxp-forge%2Fweb-compression","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxp-forge%2Fweb-compression","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxp-forge%2Fweb-compression/lists"}