Changed DynamicCache so that each page has 1 cache key (or file) per URL, the page can store metadata about the page that can be accessed during updateCacheKeyFragments()
I'm not expecting this PR to go in as is, but maybe we can reach a middle-ground on achieving something like this.
The use case for this is that I want to be able to cache variants of certain page types if a user has set their location to certain cities.
public function updateCacheKeyFragments(array &$fragments, array $meta) {
if (isset($meta['Record']['ClassName']) && $meta['Record']['ClassName'] === 'MySpecificPage') {
$fragments[] = singleton('Location')->getCityID();
} else {
$fragments[] = false;
}
}
Changed DynamicCache so that each page has 1 cache key (or file) per URL, the page can store metadata about the page that can be accessed during updateCacheKeyFragments()
I'm not expecting this PR to go in as is, but maybe we can reach a middle-ground on achieving something like this.
The use case for this is that I want to be able to cache variants of certain page types if a user has set their location to certain cities.
Related issue: https://github.com/tractorcow/silverstripe-dynamiccache/issues/62