Copied to clipboard

Flag this post as spam?

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


  • Valerie 67 posts 163 karma points
    Jul 16, 2015 @ 06:58
    Valerie
    0

    Media cache update issues

    Hello,

    I have a page that posts some values, then updates a custom property on media items to be these values. I then render out some nodes from a multipicker that use these media items.

    So Form with property values -> post -> update media custom property on all affected items -> redirect to page -> render out nodes from a multipicker on a member that consume these media items.

    An abridged version of the code is this

    foreach (var item in itemsWithUpdatedCustomProperty)
                {
                    item.SetValue("myProperty",value);
                    mediaService.Save(item);
                    mediaService.RebuildXmlStructures(item.Id);
                }
                contentService.SaveAndPublishWithStatus(contentThatUsesTheMediaItem);
    

    When I render out the media items the property has been updated but on the nodes it is still the old value, or sometimes a few of the nodes have updates but not all of them.

    I tried calling the mediaservice.RebuildXmlStructures() but it doesn't help. I also tried calling SaveAndPublish again on the nodes that use the media items but it also has no effect.

    If I wait for half a second then render the page the values are correct which makes me think it's something to do with the media cache being slow to update?

    How long would you expect it to take the cache to update is this normal?

  • Robert J. Bullock 386 posts 405 karma points
    Jan 14, 2016 @ 18:03
    Robert J. Bullock
    0

    I have a similar issue. Strange nobody replied to your question.

Please Sign in or register to post replies

Write your reply to:

Draft