PHP code example of wedevelopnl / silverstripe-fpc-purge

1. Go to this page and download the library: Download wedevelopnl/silverstripe-fpc-purge 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/ */

    

wedevelopnl / silverstripe-fpc-purge example snippets


public function updateCacheControl(): void
{
    HTTPCacheControlMiddleware::singleton()
        ->enableCache()
        ->setSharedMaxAge(3600)
        ->setMaxAge(60);
}

public function updateCacheControl(): void
{
    HTTPCacheControlMiddleware::singleton()
        ->enableCache()
        ->setSharedMaxAge(600)
        ->setMaxAge(0);
}