I've to develop a custom php caching module for a website having a lot of contents (the full cache could reach about 500.000 items). Is it better to save my cached data directly on the filesystem or to save them on a DB table? In the first case for each request I've only to read and return a file (but I'all have a directory containing 500.000 files!), in the second I have to perform a query on a sigle table (with 500.000 entries indexed by using the "URL" field).
Which is, in your opinion, the best solution in terms of performances?
Thanks in advance!