PHP code example of visuellverstehen / statamic-advanced-invalidator

1. Go to this page and download the library: Download visuellverstehen/statamic-advanced-invalidator 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/ */

    

visuellverstehen / statamic-advanced-invalidator example snippets


use VV\AdvancedInvalidator\AdvancedInvalidator;

// …

'invalidation' => [
    'class' => AdvancedInvalidator::class,
    
    'rules' => [
        'collections' => [
            'pages' => [
                'urls' => [
                    // urls to invalidate
                ],
                'named_routes' => [
                    // route names
                    // routes will be resolved and merged with urls above
                    'user.login',
                ],
                'keys' => [
                    // cache key names
                    'my-cache-key',
                ],
                'tags' => [
                    // when using the CacheTracker package you can add
                    // tags that should be invalidated
                    'partial:sitemap',
                ],
            ],
        ],
    ]
]