file serving with advanced options for caching, headers, and error handling, compatible with Express middleware.