adsazad / symfony-etagging
etagging bundle for symfony
Installs: 20
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 1
Type:symfony-bundle
Requires
- php: ^7.1.3
- ext-ctype: *
- ext-iconv: *
- sensio/framework-extra-bundle: ^5.2
- symfony/flex: ^1.0
- symfony/framework-bundle: ~4.4|5.0.*
- symfony/yaml: ~4.4|5.0.*
Conflicts
This package is auto-updated.
Last update: 2024-10-30 00:21:06 UTC
README
Installation
composer require adsazad/symfony-etagging
Usage
etagResponse() function will work on any symfony response.
// Add at the top of class use Adsazad\SymfonyEtaggingBundle\Util\EtaggingInterface;
// 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
// Add Costum Headers $ets->addCustom($key, $value);
Set Max Age
// 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