{"id":15525070,"url":"https://github.com/staabm/http-cache-control","last_synced_at":"2025-06-25T22:06:35.013Z","repository":{"id":57663623,"uuid":"480288452","full_name":"staabm/http-cache-control","owner":"staabm","description":"http cache-control tools, to ease http handling for common caching use-cases","archived":false,"fork":false,"pushed_at":"2022-04-11T12:59:48.000Z","size":6,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-05T10:45:33.459Z","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/staabm.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}},"created_at":"2022-04-11T08:18:26.000Z","updated_at":"2022-04-12T14:22:56.000Z","dependencies_parsed_at":"2022-09-16T19:11:42.192Z","dependency_job_id":null,"html_url":"https://github.com/staabm/http-cache-control","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/staabm/http-cache-control","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staabm%2Fhttp-cache-control","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staabm%2Fhttp-cache-control/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staabm%2Fhttp-cache-control/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staabm%2Fhttp-cache-control/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/staabm","download_url":"https://codeload.github.com/staabm/http-cache-control/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staabm%2Fhttp-cache-control/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261960542,"owners_count":23236574,"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-02T10:54:29.619Z","updated_at":"2025-06-25T22:06:34.992Z","avatar_url":"https://github.com/staabm.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Http-Cache-Control\n------------------\n\nA tiny lib which provides documented [constants](https://github.com/staabm/http-cache-control/blob/main/lib/Constants.php) and [example use-cases](https://github.com/staabm/http-cache-control/blob/main/lib/UseCase.php) for the HTTP `Cache-Control` header, based on the [official cloudflare documentation](https://developers.cloudflare.com/cache/about/cache-control/).\n\nSending proper Cache-Control headers is essential to each web-application, but the required keywords are sometimes misleading and ambiguous. \nThis library aims to provide a more reliable and consistent way to set the Cache-Control header.\n\n\nExample\n-------\n\n```php\nuse staabm\\HttpCacheControl\\Constants;\nuse staabm\\HttpCacheControl\\UseCase;\n\nclass MyController {\n    public function sendPdf(string $pdfFile) {\n        header(Constants::CACHE_CONTROL .':'. UseCase::cacheOnBrowserAndProxyRequireProxyRevalidation());\n        \n        readfile($pdfFile);\n    }\n    \n    public function sendGdpr(string $pdfFile) {\n        header(Constants::CACHE_CONTROL_CLOUDFLARE .':'. UseCase::cacheOnBrowserAndProxyForDifferentTime(300, 3600));\n        \n        readfile($pdfFile);\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstaabm%2Fhttp-cache-control","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstaabm%2Fhttp-cache-control","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstaabm%2Fhttp-cache-control/lists"}