MadhackerZA
10/17/2024, 8:58 AM// Get document from cache
_publishedContentQuery.Content(Constant.AvailablePricesDocumentGuid
)
//Logic to test if the data is still valid or must be updated
var doc = _ContentService.GetById(Constant.AvailablePricesDocumentGuid);
doc.SetValue("itemPrice", apiResponse.Price)
_contentService.Save(doc);
_contentService.Publish(doc,[]);
In the back office I can see the data is updated, but when refreshing the page it needs to display on has the old data and that's using IPublishedContentQuery.
If i navigate to the back office and click on save and publish the content cache is updated and updated on the front end
Any idea what i could be doing wrong? To my knowledge calling .Publish() should update the content cache, could be wrong.
Any help would be appreciated.
Thanks in advanced.Rachel D
10/17/2024, 10:08 AM_contentService.SaveAndPublish(doc)
, you may have a race condition where it's publishing the old content before saving the new valuesMadhackerZA
10/17/2024, 11:58 AMMadhackerZA
10/17/2024, 12:01 PMSiempreSteve
10/17/2024, 12:52 PMRachel D
10/17/2024, 1:04 PM