PHP code example of fahlgrendigital / packages-statamic-cache-server
1. Go to this page and download the library: Download fahlgrendigital/packages-statamic-cache-server 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/ */
fahlgrendigital / packages-statamic-cache-server example snippets
' \App\Models\Product::class
]
'header' => env('CACHE_SERVER_HEADER', 'X-Cache-Trigger')
'triggers' => [
CacheHeader::BUILD => env('CACHE_SERVER_HEADER_BUILD', CacheHeader::BUILD),
CacheHeader::STATIC_CLEAR => env('CACHE_SERVER_HEADER_STATIC_CLEAR', CacheHeader::STATIC_CLEAR),
],
'connections' => [
'database' => [
'connection' => env('QUEUE_DB_CONNECTION', 'mysql'), // add this line
'driver' => 'database',
'table' => 'jobs',
'queue' => 'default',
'retry_after' => 90,
'after_commit' => false,
],
]
'connections' => [
'queue-mysql' => [
'driver' => 'mysql',
'url' => env('DATABASE_URL'),
'host' => env('QUEUE_DB_HOST', '127.0.0.1'),
'port' => env('QUEUE_DB_PORT', '3306'),
'database' => env('QUEUE_DB_DATABASE', 'forge'),
'username' => env('QUEUE_DB_USERNAME', 'forge'),
'password' => env('QUEUE_DB_PASSWORD', ''),
'unix_socket' => env('QUEUE_DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'prefix_indexes' => true,
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],
]
'failed' => [
'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
'database' => env('QUEUE_DB_CONNECTION', 'queue-mysql'),
'table' => 'failed_jobs',
],
bash
php artisan vendor:publish --provider=FahlgrendigitalPackages\StatamicCacheServer\CacheServerProvider
bash
php artisan fm:static:warm