Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Sam Marshallsay 35 posts 135 karma points
    Nov 24, 2015 @ 11:41
    Sam Marshallsay
    0

    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.

Please Sign in or register to post replies

Write your reply to:

Draft