PHP code example of media24si / response-cache

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

    

media24si / response-cache example snippets

 php
Media24si\ResponseCache\ResponseCacheServiceProvider::class
 bash
$ php artisan vendor:publish
 php
'ResponseCacheManager' => Media24si\ResponseCache\Facades\ResponseCacheManagerFacade::class
 php
\Media24si\ResponseCache\Http\Middleware\CacheMiddleware::class
 php
return response()->json(['name' => 'John'])
		->setPublic()
		->setMaxAge(600);
 php
return response()->json(['name' => 'John'])
		->setPublic()
		->setMaxAge(600)
		->header('cache-tags', 'foo,bar,john,doe');
 php
ResponseCacheManager::flushTag('foo')