Currently the QueryCachingMiddleware buses cache based on the LastEdited date - but if the query includes versioned records, and something was deleted after the LastEdited date, we should probably bust the cache for that too.
We may also find that this is still not sufficient - we may want a more robust way to define what is used to bust the cache here... though note that the key was already generated prior to this and may include all the things we want to include already.
This is a secondary layer of cache busting and may even be redundant - the $key being passed in should perhaps already include this information.
Description
Currently the
QueryCachingMiddleware
buses cache based on theLastEdited
date - but if the query includes versioned records, and something was deleted after theLastEdited
date, we should probably bust the cache for that too.QueryCachingMiddleware::getCachedResponse() could be improved to get last-deleted/modified as well for versioned records. See https://github.com/silverstripe/silverstripe-graphql/blob/7684d1592f65d85816c2eb0d94f11414771b7081/src/Middleware/QueryCachingMiddleware.php#L115
Notes