Connect middleware to enable intelligent cache headers for dynamic content