Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/adsazad/symfony-etagging
Etagging bundle for symfony to increase speed of your webpage
https://github.com/adsazad/symfony-etagging
cache caching etag php symfony symfony-bundle
Last synced: about 1 month ago
JSON representation
Etagging bundle for symfony to increase speed of your webpage
- Host: GitHub
- URL: https://github.com/adsazad/symfony-etagging
- Owner: adsazad
- License: mit
- Created: 2020-05-12T08:51:40.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-02-01T20:00:13.000Z (almost 2 years ago)
- Last Synced: 2024-09-30T17:23:27.563Z (about 2 months ago)
- Topics: cache, caching, etag, php, symfony, symfony-bundle
- Language: PHP
- Homepage:
- Size: 56.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Etagging Bundle For Symfony
### Installation
```
composer require adsazad/symfony-etagging
```# Usage
etagResponse() function will work on any symfony response.```php
// Add at the top of class
use Adsazad\SymfonyEtaggingBundle\Util\EtaggingInterface;
```
```php
// Your action
public function myaction(Request $request, EtaggingInterface $etag){
$response = $this->render('mypage.twig',['parameters'=>'p1']);// Return Etag Response
return $etag->etagResponse($response);
}
```### Add Custom Headers
Add This before Etag Response
```php
// Add Costum Headers
$ets->addCustom($key, $value);
```## Set Max Age
```php
// Set Max Age In Seconds (Default 1 Day)
$ets->setMaxAge(60*60*24); // 1 Day
// Set Max Age In Seconds (Default 1 Day)
$ets->setSharedMax(60*60*10); // 10 Hours
```