Skip to main content

Notifications

Power Pages - General Discussions
Unanswered

Sync delay between updated data and power page

Like (0) ShareShare
ReportReport
Posted on 30 Aug 2024 15:03:36 by
Hi Everyone,
 
i have a power page that acts as a shop to buy products. In this shop i want to shop the person that is logged in (contact table) how much budget he has.
I get the budget using an api call that is executed when the page is loaded. 
The issue i have is when i submit an order and go back to the home page the budget in dataverse is updated but the budget on that i show on the power page is not.
I feel like there is a delay between of 3 to 5 minutes when the order is submitted and the budget is updated. If i check dataverse i can see the updated budget immediately but when i refresh the page and debug the api call, It still shows the old value of the column and not the new value that has been updated.
 
Anyone ideas on how to fix it? i am using the contacts default table.
 
Thansk in advance!
 
Categories:
  • Suggested answer
    SaiRT14 Profile Picture
    SaiRT14 1,770 on 03 Sep 2024 at 19:33:40
    Sync delay between updated data and power page
    • Disable or Bypass Caching: Ensure your API requests fetch fresh data by appending unique parameters to the URL to prevent caching.

    • Force Data Refresh: Use JavaScript to clear cached data or trigger the API call again after an order is processed.

    • Use Dataverse Change Tracking: Implement change tracking in Dataverse to trigger a real-time update on the Power Page when the budget changes.

    • Reduce API Call Delay: Optimize your API to minimize server-side delays and ensure immediate reflection of changes in Dataverse.

  • Suggested answer
    GWham Profile Picture
    GWham 54 on 03 Sep 2024 at 16:09:07
    Sync delay between updated data and power page
    How are you displaying the result and where are you displaying them?
     
    You are falling victim of portal cache.
     
    1. If you are using a entity list, id suggest that you add a filter condition where createdon not equal now  so that it always performs a query.
     
    2. If you are doing fetchxml add a filter condition to force the cache through.
    <condition attribute="createdon" operator="ne" value="{{now}}" />   
    3. If your expecting your results in the header for whatever reason e.g. a shopping basket number increasing then try disabling the site setting.
    header/outputcache/enabled
     
     
     
  • Suggested answer
    Fubar Profile Picture
    Fubar 7,637 on 01 Sep 2024 at 22:04:46
    Sync delay between updated data and power page
    Your delay is most likely due to the portal Cache.  Updates made directly in Dataverse from another interface do not push to the cache immediately. Similar can also occur when using asynchronous processes or you have a process that runs and creates/updates a record that is not the Primary record (e.g. update a record on the portal,  that record is considered the Primary, this triggers a process that creates a record in different table - this record is considered the Secondary record).
    It is not clear from your description if the issue is just that you are using asynchronous processes (note: standard Dataverse Flow is asynchronous), if so use synchronous ones (realtime plugin or realtime Workflow, or possibly PowerPages Flow), or if it is the Secondary record type issue.
     
    If you are reading the value from the portal using the Portals Web API or using Liquid fetchxml there is a workaround where you can include a criteria that will always be true in your query that makes the query close to unique (so the portal is forced to call Dataverse rather than just the cache), e.g. add createdon is less than today (where the value you use for today is formatted down to seconds).

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

End of Year Newsletter…

End of Year Community Newsletter…

Tuesday Tip #12 Start your Super User…

Welcome to a brand new series, Tuesday Tips…

Tuesday Tip #11 New Opportunities…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 144,654

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,440

Leaderboard
Loading started