We have a case where we need to clear the cache of a specific page, and not its child pages when an entry in a channel is saved. After quite a bit of debugging and realizing that I just can’t put in
about/press-releases
because the cache drivers (Redis in our case) adds a /* to the end so it searches for all children, which is not very intuitive. It was only after looking through the source code that I realized I could use a regex, so I came up with this
/#about\/press-releases$#
, which almost works, except the following lines do not strip out the first #. I believe the following change should be made:
line 557 of Ce_cache_break.php
$sub_path = substr( $path, strlen( $type ) + 1 ); $sub_path = rtrim($sub_path, '#'); //trim the #'s $sub_path = str_replace('#', '\#', $sub_path);
to
$sub_path = substr( $path, strlen( $type ) + 1 ); $sub_path = str_replace('#', '', $sub_path);
Stripping all of the # is what is required for the regex to work, b/c later on around line 607 its adding them back when in the preg_match call.
|