1. Go to this page and download the library: Download effiana/phpfastcache-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.
<?phprequire_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
effiana / phpfastcache-bundle example snippets
publicfunctionindexAction(Request $request, Phpfastcache $phpfastcache){
$cache = $phpfastcache->get('filecache');
$item = $cache->getItem('myAppData');
if (!$item->isHit() || $item->get() === null) {
$item->set('Wy app has now superpowers !!')->expiresAfter(3600);//1 hour
$cache->save($item);
}
// replace this example code with whatever you needreturn$this->render('default/index.html.twig', [
'myAppData' => $item->get(),
'base_dir' => realpath($this->getParameter('kernel.root_dir').'/..'),
]);
}