I found out exactly why the cache was not being cleared. Incorrect code.
< my $CachingFile = $FreshPorts::Config::CachingRoot . '/cache/' . $category_name . '.' . $port_name; --- > my $CachingFile = $FreshPorts::Config::CachingRoot . '/cache/ports/' . $category_name . '/' . $port_name . '.*.html';
The first line is the existing production code. It refers to the old caching method, which was everything in one directory. The new strategy puts ports into a layered cached that reflects the directories in the ports tree.
Part of the problem is using PHP to create cache entries, and Perl to remove the cache entries. It is harder to keep the code in sync. The PHP code is used by the website. The Perl code is used to process incoming commits.
Even with fixing this error, the window [mentioned in the previous post] must be closed.