BOOMR.plugins. CACHE_RELOAD


The cache reload plugin forces the browser to update its cached copy of boomerang.

The file at url should look like the sample below.

For information on how to include this plugin, see the Building tutorial.

Beacon Parameters

This plugin adds no parameters to the beacon.

See:

Example

<!doctype html>
<html>
<head>
  <script src="boomerang.js"></script>
</head>
<body>
  <script>
  // required version needs to be passed in as a query string parameter
  // like v=0.9.123456789
  var boom_ver = BOOMR.version.split('.'),
  var reqd_ver = location.search.replace(/.*v=([0-9\.]+)/, '$1').split('.');
  if ((boom_ver[0] < reqd_ver[0])
    || (boom_ver[0] == reqd_ver[0] && boom_ver[1] < reqd_ver[1])
    || (boom_ver[0] == reqd_ver[0] && boom_ver[1] == reqd_ver[1] && boom_ver[2] < reqd_ver[2])
  ) {
    location.reload(true);
  }
  </script>
</body>
</html>

Methods


init(config)

Initializes the plugin.

Parameters:

Name Type Description
config object

Configuration

Properties
Name Type Argument Description
CACHE_RELOAD.url string <optional>

By default, this is set to the empty string, which has the effect of disabling the Cache Reload plugin.

Set the url parameter to the URL that will do handle forcing the reload.

See the example for what this URL's output should look like.

Returns:

BOOMR.plugins.CACHE_RELOAD The CACHE_RELOAD plugin for chaining


is_complete()

This plugin is always complete (ready to send a beacon)

Returns:

Type: boolean

true


is_complete()

This plugin is always complete (ready to send a beacon)

Returns:

Type: boolean

true