Having issues with unpublished content appearing in the front end.
Our issue is that items that haven't actually been published are appearing in the front end when we are querying the tree with a query similar to helper.TypedContent(1234).Descendants().Where(...
I think this is because the editor is in preview mode when they are viewing the site and so is having unpublished content returned when IPublishedContent nodes are returned, however the site is caching this data and then it is being displayed to users.
What is the best way to ensure this data is not being cached? We're using a custom output cache that we invalidate when people do things like publish on the back end. Maybe I could detect if a user is in publish mode somehow?
Thanks for any assistance!
EDIT: I'm going to try VaryByCustom HttpContext.Current.Request.Cookies["UMB_PREVIEW"] and see how it goes.
Having issues with unpublished content appearing in the front end.
Our issue is that items that haven't actually been published are appearing in the front end when we are querying the tree with a query similar to helper.TypedContent(1234).Descendants().Where(...
I think this is because the editor is in preview mode when they are viewing the site and so is having unpublished content returned when IPublishedContent nodes are returned, however the site is caching this data and then it is being displayed to users.
What is the best way to ensure this data is not being cached? We're using a custom output cache that we invalidate when people do things like publish on the back end. Maybe I could detect if a user is in publish mode somehow?
Thanks for any assistance!
EDIT: I'm going to try VaryByCustom HttpContext.Current.Request.Cookies["UMB_PREVIEW"] and see how it goes.
is working on a reply...