prefetcher
Reactive icon

Prefetcher

Stable version 1.0.2 (Compatible with OutSystems 11)
Uploaded
 on 22 March 2024
 by 
5.0
 (2 ratings)
prefetcher

Prefetcher

Documentation
1.0.1

Input parameters

  1. Include: (Optional) Regex patterns for assets to prefetch from the Manifest. Leaving this blank will download all assets.
  2. Exclude: (Optional) Regex patterns for assets to exclude from prefetching.
  3. Order: (Optional) Prioritize the order of asset prefetching (e.g., [".js", ".css"]).
  4. Delay: (Optional) Delay in milliseconds between fetch.

Event

  1. OnPrefetchComplete: Triggered when all the assets has been downloaded.


prefetch-service-worker.js

This file is required to be in the root folder as service worker will only catch requests from clients under the service worker's scope. Please save it from the Prefetch module and import it your module and remember to set it to deploy to target directory


Sample of application manifest $OS_<ModuleName>&ApplicationInfo

{

  "manifest": {

    "versionToken": "CbLdPJ6IyUH9DWWHHDZJuA",

    "versionSequence": 275,

    "urlVersions": {

      "/PrefetcherDemo/_error.html": "?GpQQLI4fy6qLI4rBpQFPOQ",

      "/PrefetcherDemo/css/_Basic.css": "?EqGzAe81QbZLXJyfY3oLwA",

      "/PrefetcherDemo/css/Banking_Th.BankingTheme.css": "?FkZ4X17MAQOW6fHdGGU39A",

      ...

    },

    "urlMappings": {

      "/PrefetcherDemo": "/PrefetcherDemo/index.html?PZxZm6d1nwD11trJvzCmrA",

      ...

    },

    ...

  }

}


Loading assets from disk cache is a good sign that the Prefetcher component works


1.0.0

Input parameters

  1. Include: (Optional) Regex patterns for assets to prefetch from the Manifest. Leaving this blank will download all assets.
  2. Exclude: (Optional) Regex patterns for assets to exclude from prefetching.
  3. Order: (Optional) Prioritize the order of asset prefetching (e.g., [".js", ".css"]).
  4. Delay: (Optional) Delay in milliseconds between fetch.

Event

  1. OnPrefetchComplete: Triggered when all the assets has been downloaded.


prefetch-service-worker.js

This file is required to be in the root folder as service worker will only catch requests from clients under the service worker's scope. Please save it from the Prefetch module and import it your module and remember to set it to deploy to target directory


Please see the demo for example. Thank you.