PHP code example of jan-herman / kirby-siteground-cache

1. Go to this page and download the library: Download jan-herman/kirby-siteground-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/ */

    

jan-herman / kirby-siteground-cache example snippets


return [
    'cache' => [
        'pages' => [
            'active' => true,
            'type'   => 'siteground',
        ]
    ]
];

return [
    'cache' => [
        'pages' => [
            'active' => true,
            'type'   => 'siteground',
            'maxAge' => 6000,
        ]
    ]
];

return [
    'cache' => [
        'pages' => [
            'active' => true,
            'type'   => 'siteground',
            'maxAge' => 6000,
            'ignore' => fn ($page) => $page->template()->name() === 'contact',
        ]
    ]
];

return [
    'cache' => [
        'pages' => [
            'active' => true,
            'type'   => 'siteground',
            'ignore' => ['contact', 'private-area'],
        ]
    ]
];