Why do you define _ext_ and _mime_type_ at each request?
I think these code should be moved to configure method.