Offline Mode

Offline Mode lets end-users work seamlessly with Skuid pages even when they do not have an internet connection. Changes to models and records are cached while the user is offline; when internet access is restored, these changes are sent to the appropriate data source.

Offline Mode works with all data source types, and with most components. The following components, however, will not work with Offline Mode (meaning that these components may not load into the page, or behave as expected, while the user is offline):

  • Chatter
  • Search
  • File Upload
  • Geocharts

Note

Offline Mode is a runtime experience only. It is not possible to build Skuid pages while offline, though pages in Preview can be updated and cached while offline.

Activating Offline Mode

Admins can activate or deactivate Offline Mode as a global setting for a site. Offline Mode is deactivated by default. To activate it:

In Skuid Platform [[]]

  1. Navigate to Configure > Site > Offline.
  2. Check Active.

In Skuid on Salesforce [[]]

  1. Navigate to Configure > Org Preferences > Offline Mode.
  2. Check Activate Offline Mode.
  3. Create the initial manifest by clicking Create/Update Application Manifest.

Offline Syncing Properties

Once Offline Mode is activated, two properties become available to help tailor the user experience for syncing offline changes:

  • Auto-sync Offline Changes When Connected: If checked, Skuid will automatically begin to sync offline changes when the user connects/reconnects to the internet. Auto-sync can still require user confirmation if Require Confirmation Before Sync is enabled. This is the default behavior and applies to all pages.

    If this option is disabled, the Sync Changes Made Offline action must occur for syncing to begin.

  • Require Confirmation Before Sync: If checked, the user must confirm a sync—whether automatic or initiated by the Action Framework—before syncing begins.

    This confirmation will appear to the user with the message Begin syncing changes made offline?. The user can then click Start or Cancel.

Using Offline Mode

Offline Mode is available for Skuid Platform and Skuid on Salesforce (Classic and Lightning Experience). All users will enjoy the following features:

  • Offline notification: Skuid displays a notification at the top of the page indicating that the user is Currently Offline. While Skuid will periodically check for internet connection, users may manually check by clicking the reconnect icon fa-refresh.

  • Syncing: When a user is reconnected and logged into the Skuid site, it is possible for the syncing process to begin. This can happen as soon as the user reconnects if Auto-sync Offline Changes When Connected is enabled. Otherwise, syncing will begin whenever the Sync Changes Made Offline action occurs.

    When syncing, Skuid displays a notification at the bottom of the page that it is syncing (to the appropriate data source) any changes made while offline. If no changes were made while offline, this notification will not show.

    • Reload any page to start syncing changes on all pages.

    • Multiple changes will take longer to sync than a few changes.

      Warning

      The user must also be logged into the Skuid site to trigger data syncing.

  • Conflict resolution: If one user makes changes to the page while online, and a different user makes changes to the page while offline, Skuid will notify the offline user—once they are back online—that there are conflicts. Skuid will ask if they want to …

    • Send the changes, which will overwrite those made by the online user.

    • Cancel the changes.

      Warning

      If this option is chosen, any and all changes made while offline will be canceled, not just the changes that had conflicts.

Offline Mode’s Cache Requirement

For a page to be available offline, the user has to have visited the page while online at some point, so the page is included in the cache. If the page is not included the cache, the user cannot save offline changes to it.

Note

“Incognito” and other private browsing modes do not store a cache, so users working within these modes will not able able to use Offline Mode.

Warning

  • If you clear the cache, pages will not be available until you visit them again while online.
  • If you clear all temporary internet files, the Skuid cache will be deleted as well, meaning any unsynced data updates will be deleted.
  • The cache—i.e. any unsynced data—will be held for one week (7 days) only.

Performance Differences with Skuid Platform

Refreshing [[]]

After making changes made to a page while in Offline Mode, those changes can be displayed by refreshing the page.

Caching [[]]

When Offline Mode is enabled, Skuid prioritizes caching pages. So, if a user is online and visits a new Skuid site domain, Skuid will cache the Javascript files needed to run Skuid for that entire domain. Since Skuid runs multiple files, this process could take up to 20 seconds (depending on the speed of the network connection). The process is performed in the background and will not affect page load times.

Note

This process only happens when an update is needed or a user visits the domain for the first time in that browser.

Warning

If you clear the cache, pages will not be available until you visit them again while online.

Performance Differences with Skuid on Salesforce

Lightning Experience [[]]

In Offline Mode, users can make changes to previously-visited pages and save those changes, but they cannot display those changes by refreshing the page. Refreshing will produce a Salesforce “offline error.” However, the saved changes will display once the user is back online.

Salesforce1 [[]]

Unlike with Salesforce Lightning, Salesforce1 users can make and save changes to Skuid pages in their Salesforce1 app, then refresh the page to see those changes displayed. Users will also be able to visit pages they have already visited while offline.

Salesforce Classic / Visualforce [[]]

In Offline Mode, users can make changes to previously-visited pages and save those changes, but if they refresh the page while offline, the refreshed page will not display. The data is still cached, but the user cannot see it.

However, utilizing the skuid:page Visualforce deployment method while setting the manifest attribute will enable users to refresh the page while offline.

If you are already using the skuid:page Visualforce component for your Visualforce overrides, you’ll just need to add manifest="{!$Resource.AppManifest}" to your markup.

For example:

<apex:page
  readonly="true"
  showHeader="false"
  sidebar="false"
  docType="html-5.0"
  title="MyOfflinePage"
  manifest="{!$Resource.AppManifest}">
    <skuid:page page="MyOfflinePage" />
</apex:page>

If you are not already using skuid:page Visualforce overrides or would like more examples:

  1. Complete the prerequisite steps listed in the skuid:page Visualforce component topic if you have not already done so.
  2. Use the Visualforce markup form and enable Allow data refresh in Offline Mode? to generate proper Visualforce markup for your overrides.

Warning

If the page properties Show Salesforce Header and Show Salesforce Sidebar options are true, the page will not function in Offline Mode. Ensure that these properties are false for any page that you wish to be available offline.

Caveat: XML caching [[]]

Similarly, page XML is aggressively cached; however, there is no “client side” setting for pages. If you make changes to a page that is offline enabled, you need to:

  1. Navigate to Configure > Org Preferences > Offline Mode.
  2. Check Create/Update Application Manifest.

This refreshes that page’s XML instead of using a cached response, so that users will get the most recent updates to that page the next time they visit it.

Warning

This must be done every time a page is updated and those changes are deployed, or users will not see administrator updates to the page.

Because of this, Skuid recommends that you do not set a page to Offline Mode until you have completed making page changes.