statamic / ideas

💡Discussions on ideas and feature requests for Statamic
https://statamic.dev
32 stars 1 forks source link

Make `all` available on an items within static caching validation rules #1193

Closed robdekort closed 4 months ago

robdekort commented 4 months ago

Currently you can do the following in static caching invalidation rules:

return [
    'invalidation' => [
        'class' => null,
        'rules' => 'all'
   ]
];

or

return [
    'invalidation' => [
        'class' => null,
        'rules' => [
            'collections' => [
                'blog' => [
                    'urls' => [
                        '/blog',
                        '/blog/category/*',
                        '/',
                    ]
                ],
            ],
            'taxonomies' => [
                'tags' => [
                    'urls' => [
                        '/blog',
                        '/blog/category/*',
                        '/',
                    ]
                ]
            ],
            'globals' => [
                'settings' => [
                    'urls' => [
                        '/*'
                    ]
                ]
            ],
            'navigation' => [
                'links' => [
                    'urls' => [
                        '/*'
                    ]
                ]
            ]
        ]
    ]
];

Since you can expand on collections, taxonomies, globals and navigation on a later date, it would be helpful if you can set those items to all individually so the rules will keep on working for those items. Like this:

'invalidation' => [
    'class' => null,
    'rules' => [
         'collections' => [
             'blog' => [
                 'urls' => [
                     '/blog',
                     '/blog/category/*',
                     '/',
                 ]
             ],
         ],
        'globals' => 'all',
        'navigation' => 'all',
        'taxonomies' => 'all'
    ]
],
jacksleight commented 4 months ago

https://github.com/statamic/ideas/issues/860 🙂

robdekort commented 4 months ago

Well well well, look at that!

robdekort commented 4 months ago

Of course you did 😃

duncanmcclean commented 4 months ago

Going to close this issue in favour of that one. (sorry rob 😃 )

robdekort commented 4 months ago

All good, haha.

robdekort commented 4 months ago

Assuming it'll get merged now ;-)