Possible to var output cache by host header?


We have a site that listens on a few different host headers. We have a couple of spots on the site that check the host header and change the styling slightly. 

Currently, I have the output cache set to a 4 hour expiration. Depending on the site that gets hit first, it's cache is used for all the host bindings.

Is there a way to configure this in EPiServer not to happen?



Sep 11, 2014 1:07

I had this problem as well. I thought the httpCacheVaryByCustom="path" should do it but it seems it doesn't.

What we did is to add host to the ContentOutputCache attribute.

[ContentOutputCache(VaryByHeader = "host")]

Sep 11, 2014 9:23

Thanks for the response. This site is WebForms based, not MVC. I will take a look for the equivalnt. 


Sep 11, 2014 14:15
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.