Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bigyouth/page-cache-bundle
This bundle provides a simple page caching solution working as a in-app reverse proxy.
https://github.com/bigyouth/page-cache-bundle
bundle cache php redis symfony symfony-bundle
Last synced: about 2 months ago
JSON representation
This bundle provides a simple page caching solution working as a in-app reverse proxy.
- Host: GitHub
- URL: https://github.com/bigyouth/page-cache-bundle
- Owner: bigyouth
- License: mit
- Created: 2018-01-17T10:53:24.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-12-08T21:47:12.000Z (about 5 years ago)
- Last Synced: 2024-11-08T02:33:05.514Z (about 2 months ago)
- Topics: bundle, cache, php, redis, symfony, symfony-bundle
- Language: PHP
- Homepage:
- Size: 38.1 KB
- Stars: 4
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Big Youth Page Cache Bundle
| Maintainability | Issues | Downloads | Release |
|:----------------------:|:-----------------------:|:-----------------------:|:-----------------------:|
[![Maintainability](https://img.shields.io/codeclimate/maintainability/bigyouth/page-cache-bundle.svg)](https://codeclimate.com/github/bigyouth/page-cache-bundle) | [![Issues](https://img.shields.io/codeclimate/issues/github/bigyouth/page-cache-bundle.svg)](https://codeclimate.com/github/bigyouth/page-cache-bundle) | [![Downloads](https://img.shields.io/packagist/dt/bigyouth/page-cache-bundle.svg?style=flat-square)](https://packagist.org/packages/bigyouth/page-cache-bundle) | [![Release](https://img.shields.io/packagist/v/bigyouth/page-cache-bundle.svg?style=flat-square)](https://packagist.org/packages/bigyouth/page-cache-bundle) |## What is it ?
This bundle provides a simple page caching solution working as an in-app reverse proxy.
## Requirements
```yml
"php": "^5.3.9|^7.0",
"symfony/cache": "^3.1"
```
## Installation### Download the bundle
Download composer at https://getcomposer.org/download/
```bash
composer require bigyouth/page-cache-bundle
```### Register the bundle
Enable the bundle by adding it to the bundles array of the registerBundles method in your project's app/AppKernel.php file :
```php
render('FrontBundle:Page:index.html.twig');}
}
```The PageCacheController rewrites the *render* function to manage and render cache data. All of your controller actions that use the *render* function will be cached.
### Cache invalidation
The **BigyouthPageCacheBundle** uses [cache tags](https://symfony.com/blog/new-in-symfony-3-2-tagged-cache) to identify your cache data. The tags are defined by the url scheme of the cached page.
For example, the page behind */products/list/my-product* will be tagged with **products**, **list** and **my-product**.
Therefore you can invalidate a product page by doing the following in your controller :
```php
// ...$this->get('by.page_cache')->invalidate(["my-product"]);
// ...
```or if you want to invalidate all product pages :
```php
// ...$this->get('by.page_cache')->invalidate(["products"]);
// ...
```
## Authors* **Alexis Smadja** - *Initial work* - [Alxss](https://github.com/Alxss)
See also the list of [contributors](https://github.com/BigYouth/page-cache-bundle/graphs/contributors) who participated in this project.
## LicenseThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.