Managing portal cache and refresh

Loading

Effective cache management is crucial for maintaining both performance and consistency in Power Pages. Caching improves load times and reduces server load, but can sometimes lead to outdated content being displayed. To ensure your portal reflects the latest updates without compromising performance, understanding how to manage cache and trigger refreshes is essential.


Table of Contents

  1. What is Portal Cache?
  2. Types of Cached Data
  3. When to Clear Cache
  4. Methods to Manage and Refresh Cache
  5. Automatic vs Manual Cache Refresh
  6. Using Portal Admin Center
  7. Programmatic Cache Invalidation
  8. Developer Best Practices
  9. Summary
  10. Tags

1. What is Portal Cache?

Power Pages (formerly Power Apps Portals) uses caching to store data like page content, configuration settings, and web roles to improve performance and reduce round-trips to Dataverse. When changes are made in the backend (e.g., Web Pages, Web Templates, Entity Permissions), they may not reflect immediately on the live portal due to this cache.


2. Types of Cached Data

Cache TypeDescription
Web PagesHTML content, navigation, metadata
Web FilesStatic assets like images, CSS, JavaScript
Site SettingsSettings that control portal behavior
Entity Forms/ListsConfiguration of forms and lists
Web Roles & PermissionsAccess control definitions
Liquid TemplatesTemplate logic and structure
Content SnippetsReusable localized content

3. When to Clear Cache

You should clear or refresh the cache when:

  • Web Page content or layout is updated
  • Web Files are replaced or changed
  • Web Templates or Liquid code is modified
  • Site Settings or Content Snippets are changed
  • Web Roles or Table Permissions are updated
  • You’ve published new pages or deleted content
  • Changes don’t appear on the portal even after publishing

4. Methods to Manage and Refresh Cache

1. Power Pages Admin Center

  • Navigate to Power Pages Admin Center
  • Select your environment → Portal Management
  • Click “Clear Cache” to manually refresh the portal cache

This process clears server-side and in-memory cache.


2. Portal Management App

Within the Portal Management Model-driven App:

  • Go to the “Portals” section
  • Select your portal record
  • Use the “Clear Configuration Cache” button

This helps when you update table permissions, web roles, or entity configurations.


3. Append ?cache=clear to URL

  • Simple and immediate:
    https://yourportal.powerappsportals.com?cache=clear
  • Triggers cache invalidation for that session/page
  • Useful during development or QA

4. Restart Portal (Last Resort)

If nothing works:

  • Go to Power Platform Admin Center
  • Find your portal → Select Restart

This restarts the portal instance and resets all caches. Use only when other methods fail.


5. Automatic vs Manual Cache Refresh

TypeBehaviorExample
AutomaticSome components like Entity List updates trigger automatic refreshForm or list metadata
ManualRequires cache clearingSite Settings, Web Templates, Content Snippets

6. Using Portal Admin Center

Steps:

  1. Go to https://admin.powerplatform.microsoft.com
  2. Choose your environment
  3. Under Resources > Portals, click your portal
  4. Select “Manage”
  5. Click “Clear cache” to force-refresh the server cache

This is the safest and most complete method of cache refresh.


7. Programmatic Cache Invalidation (Advanced)

You can call portal APIs or trigger custom workflows to refresh portal content via:

  • Power Automate flows (e.g., modify a Site Setting and clear cache)
  • Portal Web APIs (limited direct cache control)
  • Custom button in Model-driven app triggering plugin logic (e.g., custom cache control logic)

8. Developer Best Practices

  • During development, frequently use ?cache=clear or Admin Center
  • Make sure to publish content (like Web Pages and Templates) after editing
  • Use Web Files versioning to avoid browser-side caching
    (e.g., mystyle.css?v=1.1)
  • When using Liquid templates, use output comments to verify updated content
  • Keep content modular using Snippets and Templates to reduce full-page caching

Leave a Reply

Your email address will not be published. Required fields are marked *