I have a system for a file hosting site which requires a PHP script to send out the http headers for MIME type and content length of the file.
The problem I'm facing is: would be better to store the MIME type and filesize in the database with the image's entry or to calculate it using filesize() and mime_content_type() on every hit.
I am judging 'better' based on the fastest possible load time but I would like to avoid redundant data and excessive row size if the speed increase is pointless.