PHP code example of glaivepro / cachepage

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

    

glaivepro / cachepage example snippets


	...
	GlaivePro\CachePage\CachePageServiceProvider::class,
	...

    Route::get('/', 'PageController@welcome')->middleware('gpcachepage');

    Route::get('contacts', 'PageController@contacts')->middleware('gpcachepage:120');

    Route::group(['middleware' => ['gpcachepage:300']], function () {
        Route::get('about', 'PageController@about');
        Route::get('policy', 'PageController@policy');
    });

    Route::get('contacts', 'PageController@contacts')->middleware('gpcachepage:120,id');

	Route::get('contacts', 'PageController@contacts')->middleware('gpcachepage:120,role.name');

    Route::get('contacts', 'PageController@contacts')->middleware('gpcachepage:120,NULL');

	'allowSkipping' => false,

	'allowClearing' => false,

	'allowFlushing' => true,