{"id":15755152,"url":"https://github.com/wyrihaximus/reactphp-http-middleware-response-cache-session-cache-configuration","last_synced_at":"2026-01-07T23:45:39.505Z","repository":{"id":52421218,"uuid":"128670061","full_name":"WyriHaximus/reactphp-http-middleware-response-cache-session-cache-configuration","owner":"WyriHaximus","description":null,"archived":false,"fork":false,"pushed_at":"2023-12-06T05:10:39.000Z","size":90,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-06T12:31:49.178Z","etag":null,"topics":["cache","configuration","hacktoberfest","http","middleware","reactphp","session"],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/WyriHaximus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","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},"funding":{"github":"WyriHaximus"}},"created_at":"2018-04-08T18:29:22.000Z","updated_at":"2020-10-04T20:05:04.000Z","dependencies_parsed_at":"2024-10-25T06:48:45.827Z","dependency_job_id":"91725ef7-072b-4d3d-bff6-a9c1e46676bd","html_url":"https://github.com/WyriHaximus/reactphp-http-middleware-response-cache-session-cache-configuration","commit_stats":{"total_commits":29,"total_committers":3,"mean_commits":9.666666666666666,"dds":"0.48275862068965514","last_synced_commit":"250df300ab7c20f9ec4177a63297f99799b63563"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WyriHaximus%2Freactphp-http-middleware-response-cache-session-cache-configuration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WyriHaximus%2Freactphp-http-middleware-response-cache-session-cache-configuration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WyriHaximus%2Freactphp-http-middleware-response-cache-session-cache-configuration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WyriHaximus%2Freactphp-http-middleware-response-cache-session-cache-configuration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WyriHaximus","download_url":"https://codeload.github.com/WyriHaximus/reactphp-http-middleware-response-cache-session-cache-configuration/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246436381,"owners_count":20776995,"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","configuration","hacktoberfest","http","middleware","reactphp","session"],"created_at":"2024-10-04T08:20:22.939Z","updated_at":"2026-01-07T23:45:39.477Z","avatar_url":"https://github.com/WyriHaximus.png","language":"PHP","funding_links":["https://github.com/sponsors/WyriHaximus"],"categories":[],"sub_categories":[],"readme":"# Session aware cache configuration for [`wyrihaximus/react-http-middleware-response-cache`](https://github.com/WyriHaximus/reactphp-http-middleware-response-cache) \n\n[![Build Status](https://travis-ci.org/WyriHaximus/reactphp-http-middleware-response-cache-session-cache-configuration.svg?branch=master)](https://travis-ci.org/WyriHaximus/reactphp-http-middleware-response-cache-session-cache-configuration)\n[![Latest Stable Version](https://poser.pugx.org/WyriHaximus/react-http-middleware-response-cache-session-cache-configuration/v/stable.png)](https://packagist.org/packages/WyriHaximus/react-http-middleware-response-cache-session-cache-configuration)\n[![Total Downloads](https://poser.pugx.org/WyriHaximus/react-http-middleware-response-cache-session-cache-configuration/downloads.png)](https://packagist.org/packages/WyriHaximus/react-http-middleware-response-cache-session-cache-configuration)\n[![Code Coverage](https://scrutinizer-ci.com/g/WyriHaximus/reactphp-http-middleware-response-cache-session-cache-configuration/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/WyriHaximus/reactphp-http-middleware-response-cache-session-cache-configuration/?branch=master)\n[![License](https://poser.pugx.org/WyriHaximus/react-http-middleware-response-cache-session-cache-configuration/license.png)](https://packagist.org/packages/WyriHaximus/react-http-middleware-response-cache-session-cache-configuration)\n[![PHP 7 ready](http://php7ready.timesplinter.ch/WyriHaximus/reactphp-http-middleware-response-cache-session-cache-configuration/badge.svg)](https://travis-ci.org/WyriHaximus/reactphp-http-middleware-response-cache-session-cache-configuration)\n\n# Install\n\nTo install via [Composer](http://getcomposer.org/), use the command below, it will automatically detect \nthe latest version and bind it with `^`.\n\n```\ncomposer require wyrihaximus/react-http-middleware-response-cache-session-cache-configuration\n```\n\nCache configuration decorator for [`wyrihaximus/react-http-middleware-response-cache`](https://github.com/WyriHaximus/reactphp-http-middleware-response-cache) \nand [`wyrihaximus/react-http-middleware-session`](https://github.com/WyriHaximus/reactphp-http-middleware-session). When a request is going through that has \nan active session the cache is skipped and the request is passed to the next middleware in the chain. When a response is going through that has an active \nsession the response won't be stored in the cache. The order of middleware is critical for the correct working of this cache configuration decorator. The \nexample below shows the correct order.\n\n# Usage\n\n```php\n$server = new Server([\n    /** Other middleware */\n    new SessionMiddleware('Floki'), // Note that the order here is important. The session middleware MUST attach the session before the ResponseCacheMiddleware \n    new ResponseCacheMiddleware(\n        new SessionCacheConfiguration(\n            new CacheConfiguration(\n                [\n                    '/',\n                    '/robots.txt',\n                    '/favicon.ico',\n                    '/cache/***', // Anything that starts with /cache/ in the path will be cached\n                    '/api/???', // Anything that starts with /cache/ in the path will be cached (query is included in the cache key)\n                ],\n                [ // Optional, array with headers to include in the cache\n                    'Content-Type',\n                ]\n           )\n        ),\n        new ArrayCache() // Optional, will default to ArrayCache but any CacheInterface cache will work. \n    ),\n    /** Other middleware */\n]);\n```\n\n# License\n\nThe MIT License (MIT)\n\nCopyright (c) 2018 Cees-Jan Kiewiet\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwyrihaximus%2Freactphp-http-middleware-response-cache-session-cache-configuration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwyrihaximus%2Freactphp-http-middleware-response-cache-session-cache-configuration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwyrihaximus%2Freactphp-http-middleware-response-cache-session-cache-configuration/lists"}