Ok, well, pages only need to really be removed when a new page is being created, so could you not timestamp each one (eg 12345667.html, 123768823.html), and then, each time PHP generates a new file, it goes through the directory and deletes any file more than say, an hour old (using the timestamp filename). I cant see it being that slow, as keeping it maintained should keep the numbers of files that need deleting in a single shot down.
The code would look something like
PHP Code:
if ($handle = opendir('dir/to/files')) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
$file = explode(".",$file);
if ($file[0] < (time() -3600)){
unlink("dir/to/files/$file[0].html")
}
}
}
closedir($handle);
}
This is just a quick thrashout and isn't tested, but it gives you an idea of what I mean - then it can be put at the top of your php page, and whenever a user requests an html page be created, it can trim down the old ones
Bookmarks