web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Portal Cache Nightmare
Power Pages
Answered

Portal Cache Nightmare

(2) ShareShare
ReportReport
Posted on by 9
Guys, I am at my wits end.
 
I have a record, in a custom table, that the user interacts with by clicking a button that makes an external http request to an Azure resource.
 
This Azure resource then updates the record state and returns a 200 OK.
 
My Javascript then refreshes the page... and still record shows in the old state for like 5 minutes even though the value has been updated in Dataverse.
 
Here is the kicker... I'm not using an OOB entity list or anything like that to render the record. I'm doing a straight up liquid fetchxml api call to Dataverse and it still returns the old value... even via API call from portal!
 
To summarize my question is: HOW DO I FORCE THE PORTAL TO RESPECT DATAVERSE UPDATES IN REAL TIME???
Categories:
I have the same question (0)
  • lbendlin Profile Picture
    8,551 Super User 2026 Season 1 on at
    would it help to add a "&r=<random number>"  to the fetch URL ?
  • Verified answer
    eugenevanstaden Profile Picture
    441 on at
    If you update the record via the Portal API - it would break cache. As the record is being updated outside of the portal, then cache would not break.

    If you are using liquid to query then you can add this to break the cache. Just replace any_field with any field on your table.
     
     <condition attribute="any_field operator="ne" value='{{ "now" | date: "yyyy-MM-dd HH:mm:ss" }}' />
  • Suggested answer
    Suriyanarayanan V Profile Picture
    147 on at
    Hi,
    Power Pages uses aggressive server-side caching for Liquid-based FetchXML queries. Even if Dataverse updates immediately, the rendered data via Liquid can lag for up to 5 minutes, especially when:
    You've used fetchxml in a .html or .webpage file
    Output is rendered using entitylist or any custom Liquid loop
    Portal's output cache hasn't invalidated yet
    Even worse—Liquid has no awareness of dynamic changes unless the cache expires or you bypass it.
    4 Ways to Force Real-Time Data Rendering
    1. Call Power Pages Web API via JavaScript
    Skip Liquid. Use a JS fetch() call to /_api for fresh data straight from Dataverse.
    javascript
    fetch("/_api/custom_table_records(GUID)")
      .then(r => r.json())
      .then(data => {
        console.log("Live data:", data);
        // Use this to dynamically update the UI
      });
    This bypasses the Liquid rendering layer entirely. Works great with Ajax-loaded components.
    2. Use Client-Side Logic to Refresh Record Data
    If you must stick with Liquid (e.g., SEO-friendly content), use JavaScript after page load to refresh just the updated fields via a light Web API call, like:
    // Replace record ID dynamically
    let recordId = "YOUR_RECORD_ID";
    fetch(`/_api/custom_table_records(${recordId})`)
      .then(res => res.json())
      .then(data => {
        document.querySelector("#recordStatus").textContent = data.statuscode;
      });
    This blends static Liquid and dynamic client updates. Add a loading spinner if needed.
    3. Temporarily Disable Output Caching (for debugging only)
    Under Site Settings, add:
    Name: Web Page Output Cache Enabled
    Value: false
    Don't leave it off for long—performance hits hard in production.
    4. Force Data Consistency via Flow/Webhook
    If you're updating from Azure and need it reflected instantly, consider having the Azure function trigger a Power Automate Flow that does a redundant update or logs to a portal-visible table—something the portal notices immediately (dirty trick, but it works).
     
  • Suggested answer
    Fubar Profile Picture
    8,463 Super User 2026 Season 1 on at
    As you are doing a liquid fetchxml query, all you need to do is make the query 'relatively' unique by adding a criteria that is close to unique but always true - you can do this by including a criteria in your fetchxml such as  createdon is less than the liquid 'now' formatted down to the second  
    <condition attribute="createdon" operator="on-or-before" value="{{ now | "yyyy-MM-dd HH:mm:ss" }}" />
    https://learn.microsoft.com/en-us/power-pages/configure/liquid/liquid-filters#date-filters
  • ID-24120023-0 Profile Picture
    9 on at
    Thank you all so much, manipulating the query like @eugenevanstaden suggested works. You are amazing!
     
    Also, very sad and funny that this is the solution...
  • Suggested answer
    Suraj Revankar Profile Picture
    on at
    Best Solution so far is to add the modifiedon date filter like mentioned above on the api calls to get new results
  • Fubar Profile Picture
    8,463 Super User 2026 Season 1 on at
    @lbendlin no, your FetchXML/oiData statement needs to be valid. In between cache refreshes, the portal is looking at the fetchxml/oData statement /query and if it finds that it has recently used the exact same statement/query it will return the results from that previous call, so the answer is that you make your query relatively unique (and your uniqueness always needs to be true so it doesn't impact the rest of the query) - it does not need to be a date field but a date field using the date now formatted down to seconds is usually the best approach. 
    (the correct answer has already been provided in earlier posts)

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Pages

#1
Suriyanarayanan V Profile Picture

Suriyanarayanan V 45

#2
oliver.rodrigues Profile Picture

oliver.rodrigues 14 Most Valuable Professional

#3
DP_Prabh Profile Picture

DP_Prabh 13

Last 30 days Overall leaderboard