An interesting way to handle caching is to have all 404's redirected to a PHP
script.

ErrorDocument 404 /generate.php

Then in your generate.php script use the contents of $REDIRECT_URI to determine
which URL the person was trying to get to. In your database you would then
have fields linking content to the URL they affect and from that you should be
able to generate the page. Then in your generate.php script do something like:

So, the way it works, when a request comes in for a page that doesn't exist,
generate.php checks the database and determines if it should actually exist and
if so it will create it and respond with this generated data. The next request
for that same URL will get the generated page directly. So in order to refresh
your cache you simply have to delete the files.