{"id":18654788,"url":"https://github.com/wieni/wmpage_cache","last_synced_at":"2025-11-05T17:30:34.451Z","repository":{"id":47447334,"uuid":"311693862","full_name":"wieni/wmpage_cache","owner":"wieni","description":"Caches pages for anonymous users, with more customisability than the default page cache module.","archived":false,"fork":false,"pushed_at":"2024-01-07T10:16:47.000Z","size":273,"stargazers_count":0,"open_issues_count":5,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-01-28T16:47:05.290Z","etag":null,"topics":["caching","drupal-8","drupal-9","drupal-module"],"latest_commit_sha":null,"homepage":"","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/wieni.png","metadata":{"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}},"created_at":"2020-11-10T15:03:02.000Z","updated_at":"2021-10-12T09:17:59.000Z","dependencies_parsed_at":"2024-01-07T11:26:30.411Z","dependency_job_id":"1a6f2d53-faf6-4d9e-be35-d6de4f86fa18","html_url":"https://github.com/wieni/wmpage_cache","commit_stats":{"total_commits":179,"total_committers":9,"mean_commits":19.88888888888889,"dds":0.6424581005586592,"last_synced_commit":"9ae8ed8b6b250936ae1e341fba6a6a912b22211c"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wieni%2Fwmpage_cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wieni%2Fwmpage_cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wieni%2Fwmpage_cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wieni%2Fwmpage_cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wieni","download_url":"https://codeload.github.com/wieni/wmpage_cache/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239467450,"owners_count":19643605,"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":["caching","drupal-8","drupal-9","drupal-module"],"created_at":"2024-11-07T07:16:35.891Z","updated_at":"2025-11-05T17:30:34.418Z","avatar_url":"https://github.com/wieni.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Page Cache\n======================\n\n[![Latest Stable Version](https://poser.pugx.org/wieni/wmpage_cache/v/stable)](https://packagist.org/packages/wieni/wmpage_cache)\n[![Total Downloads](https://poser.pugx.org/wieni/wmpage_cache/downloads)](https://packagist.org/packages/wieni/wmpage_cache)\n[![License](https://poser.pugx.org/wieni/wmpage_cache/license)](https://packagist.org/packages/wieni/wmpage_cache)\n\n\u003e Caches pages for anonymous users, with more customisability than the default page cache module.\n\n## Why?\n- Provides more configurable options than the default page cache module\n- Allows you to choose between multiple cache storages (database, [Redis](https://github.com/wieni/wmpage_cache_redis),\n  [Flysystem](https://github.com/wieni/wmpage_cache_flysystem)) and cache invalidators/purgers (default, \n  [Cloudfront](https://github.com/wieni/wmpage_cache_cloudfront))\n\n## Installation\n\nThis package requires PHP 7.1 and Drupal 8 or higher. It can be\ninstalled using Composer:\n\n```bash\n composer require wieni/wmpage_cache\n```\n\nTo prevent unnecessary early rendering issues when creating custom controllers, a patch from the following issue should\nbe included:\n\n[#2638686: Exception in EarlyRenderingControllerWrapperSubscriber is a DX nightmare, remove it](https://www.drupal.org/project/drupal/issues/2638686)\n\n## How does it work?\n### Configuring the module\nSettings can be changed through container parameters. Check [`wmpage_cache.services.yml`](wmpage_cache.services.yml) for \na list of settings, what they do and their default values.\n\n### About cacheability metadata\nJust like the [Internal Page Cache](https://www.drupal.org/docs/administering-a-drupal-site/internal-page-cache) \u0026 \n[Dynamic Page Cache](https://www.drupal.org/docs/8/core/modules/dynamic-page-cache/overview) core modules, this module \nuses cacheability metadata (cache tags, cache contexts and max-age) to determine the cacheability of a request and to \nmake sure cached pages are invalidated when necessary.\n\n### Adding cacheable metadata from a controller\nThere are a bunch of different things you can return in a controller and cacheable metadata can be included in pretty\nmuch every one of them.\n\n#### Render arrays\nCacheability metadata can be included in a render array under the `#cache` key. For more information, please refer to \nthe [official documentation](https://www.drupal.org/docs/8/api/render-api/cacheability-of-render-arrays).\n\n#### Response objects\nCacheable `Response` objects have to implement `CacheableResponseInterface` and can use the \n`CacheableResponseTrait`. For more information, please refer to the [official documentation](https://www.drupal.org/docs/8/api/responses/cacheableresponseinterface).\n\n#### wmcontroller `ViewBuilder`\nWhen rendering a Twig template, eg. by using the wmcontroller `ViewBuilder`, all cacheable metadata of parameters that \nare passed to the template are automatically included.\n\n### Adding cacheable metadata from a Twig extension\nIf a Twig extension is returning information that will be used in a Twig template, without going through the Drupal \nrender system, any cacheability metadata will be lost. That's why it's better to dispatch cacheability metadata in the\nlogic of the Twig extension. You can do this by attaching the metadata to an empty render array and rendering it:\n\n```php\n$build = [];\n(new CacheableMetadata())\n    -\u003eaddCacheableDependency($entity)\n    -\u003eapplyTo($build);\n\n$this-\u003erenderer-\u003erender($build);\n```\n\nIn case this Twig extension is called often, this can impact performance. Another option is to collect all metadata \nuntil the end of page rendering, and attach it once in a `hook_page_attachments` implementation.\n\n## Changelog\nAll notable changes to this project will be documented in the\n[CHANGELOG](CHANGELOG.md) file.\n\n## Security\nIf you discover any security-related issues, please email\n[security@wieni.be](mailto:security@wieni.be) instead of using the issue\ntracker.\n\n## License\nDistributed under the MIT License. See the [LICENSE](LICENSE) file\nfor more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwieni%2Fwmpage_cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwieni%2Fwmpage_cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwieni%2Fwmpage_cache/lists"}