PHP code example of truongwp / php-static-cache

1. Go to this page and download the library: Download truongwp/php-static-cache 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/ */

    

truongwp / php-static-cache example snippets


$static_cache = new \Truongwp\StaticCache();

if ( $static_cache->has( 'key' ) ) {
	$value = $static_cache->get( 'key' );
} else {
	$value = do_something();
	$static_cache->set( 'key', $value );
}