We have a sitecore based responsive website, which has different content for mobile device in some pages unlike desktop. We are identifying the device type by using Http Request user Agent and have different business logic based on it.
When we have enabled sitecore HTML caching for those renderings then the logic that works with user agent logic does not work. Because sitecore cache is not getting invalidated By Vary by Device. Therefore for different device also sitecore is giving the response from same HTML cache of the rendering.
How should we handle this scenario?