PHP code example of linslin / laravel-coffee-cache
1. Go to this page and download the library: Download linslin/laravel-coffee-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/ */
linslin / laravel-coffee-cache example snippets
$coffeeCache = new CoffeeCache(__DIR__);
$coffeeCache->cacheTime = 60 * 60 * 24 * 1; //Default is one day. 60 * 60 * 24 * 1 = 1 day
$coffeeCache->minifyCacheFile = true;
$coffeeCache->enabledHosts = [
'www.production.com',
'subdomain.production.com',
]; // optional, leave this array empty if you want to cache all domains.
$coffeeCache->enabledHttpStatusCodes = [
'200',
'202',
]; // list of HTTP-Status codes which should be cached.
$coffeeCache->excludeUrls = [
'/admin',
]; // URL pattern of URLs which should not be cache. This example will exclude URLS which have "/admin" somewhere in the URL.
$coffeeCache->handle();
feeCache = new CoffeeCache(__DIR__);
$coffeeCache->cacheTime = 60 * 60 * 24 * 1; //Default is one day. 60 * 60 * 24 * 1 = 1 day
$coffeeCache->minifyCacheFile = true;
$coffeeCache->enabledHosts = [
'www.production.com',
'subdomain.production.com',
]; // optional, leave this array empty if you want to cache all domains.
$coffeeCache->enabledHttpStatusCodes = [
'200',
'202',
]; // list of HTTP-Status codes which should be cached.
$coffeeCache->excludeUrls = [
'/admin',
]; // URL pattern of URLs which should not be cache. This example will exclude URLS which have "/admin" somewhere in the URL.
$coffeeCache->handle();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.