OutSystems Platform allows you to prefetch static resources like images, CSS, and Javascript files. This speeds up the navigation between pages, improving the user experience of your apps.

When an end-user starts a new browser session, OutSystems Platform fetches the static resources the application needs. The browser caches these resources, thus avoiding a roundtrip to the server when they are needed.

Enable Resource Prefetching

You can enable resource prefetching for each application, on the environment management console.

In this example we already have a Directory application to manage employee information. To enable resource prefetching for this application, do the following:

  1. In the environment management console, navigate to the Directory application detail;
  2. Under 'Operation' check the 'Prefetch Resources' option.

To activate the changes, republish the application by clicking the 'Publish' button. And that's it! From now on, the application prefetches the resources, and displays a progress bar.

Once the resources are stored in the browser cache, your application will navigate faster between screens.

This functionality is customizable per environment. After deploying your application to another environment, you need to enable resource prefetching for the application version running on that environment.

Resource Prefetching - Under the Hood

When the 'Enable Resource Prefetching' setting is enabled, the following happens.

  1. The end-user tries to access the module default entry point using a new browser session. Instead of returning the page associated with that entry point, OutSystems Platform redirects to a loading screen. It also sends the following information on the query string:
  2. The loading screen uses the outsystems.api.preloader API to fetch the static resources from the server;
  3. When the static resources are fetched from the server, the loading screen redirects the user back to the page associated with the default entry point.

Prefetched Resources

When an application module is published, OutSystems Platform determines which static resources can be prefetched.

The following files are prefetched:

See Also

Customizing the Load Screen when Prefetching Resources