Hello!
I ran into issues with Uniform and Kirby’s cache. Basically, the cache stores entries based on URIs for all HTTP request types. This breaks POST submits because Kirby returns the cached page rather than pushing the request through.
I tried writing a route to add the URI to the cache.ignore array in kirby.php, but then it’s ignored for all HTTP request types, which is the same thing as specifying it in an cache.ignore array in config.php.
My problem with using the cache.ignore array is that my editors can change things on the fly without my knowledge and I’d rather not chase this down for every URL they come up with.
What I’m thinking might be nice are…
a) A way to specify HTTP method types in cache.ignore. Something like:
c::set('cache.ignore', [
'blog/cow', [ 'POST', 'DELETE' ]
]);
b) A way to specify wildcards in the cache.ignore array. Like:
c::set('cache.ignore', [
'cat/*'
]);
Or using the Kirby wildcard syntax:
c::set('cache.ignore', [
'cat/(:all)'
]);
So ultimately, it’d be:
c::set('cache.ignore', [
'cat/*', [ 'POST', 'DELETE']
]);
Does that make sense?
In the meantime, I’ve disabled cache altogether, which isn’t ideal…
Cheers,
topher