I am currently caching dynamically generated PHP pages by saving them to a database with an expiry time field. If the page is requested again, the program checks for a unexpire
Both options utilise the file system, as (assuming you're using MySQL without MEMORY/HEAP tables) database records are still stored in files.
If you have an active database connection at the time of requesting the cached data, I'd stick with the database.