PHP code example of visol / cacheable

1. Go to this page and download the library: Download visol/cacheable 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/ */

    

visol / cacheable example snippets


use Visol\Cacheable\Annotations as Cacheable;
use Visol\Cacheable\Annotations\Method;

/**
 * @return array
 * @Cacheable\Method(lifetime=1800, tags={"rest_service"}, security=Method::SECURITY_ROLES, cacheIdentifier=Method::CACHE_PERSISTENT)
 */
public function executeLongRunningTask(string $someArgument): array
{
    // Fetch data from API or perform long running calculations
}