Add function to clear the Webmin cache for a URL

This commit is contained in:
Jamie Cameron
2024-05-23 15:17:27 -07:00
parent 61f631c1f7
commit 5c465a587c
2 changed files with 19 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@ -11980,6 +11980,24 @@ else {
return 1;
}
=head2 clear_http_cache(url)
If a URL is in the cache, remove it
=cut
sub clear_http_cache
{
my $cfile = $url;
$cfile =~ s/\//_/g;
return 0 if (!$cfile);
$cfile = "$main::http_cache_directory/$cfile";
if (-r $cfile) {
&unlink_file($cfile);
return 1;
}
return 0;
}
=head2 check_in_http_cache(url)
If some URL is in the cache and valid, return the filename for it. Mainly