PHP code example of danilovl / cache-response-bundle
1. Go to this page and download the library: Download danilovl/cache-response-bundle library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
danilovl / cache-response-bundle example snippets
#[CacheResponseAttribute(
key: 'index',
expiresAfter: 60,
useSession: true,
useRoute: true,
useQuery: true,
useRequest: true,
useEnv: true
)]
public function index(Request $request): Response
{
return new Response('content');
}
#[CacheResponseAttribute(
key: __METHOD__,
expiresAfter: 60,
useQuery: true,
useRequest: true,
useEnv: true
)]
public function index(Request $request): Response
{
return new Response('content');
}
#[CacheResponseAttribute(factory: CachKeyFactoryClass::class)]
public function index(Request $request): Response
{
return new Response('content');
}