API Documentation for: 1.1.23
Show:

CacheManager Class

Defined in: CacheManager:8
Namespace: cloudkid

Used for managing the browser cache of loading external elements can easily load version manifest and apply it to the media loader supports cache busting all media load requests uses the query string to bust browser versions.

Methods

_getVersionByUrl

(
  • url
)
String private

Search for a version number by url

Parameters:

  • url String

    The url to search

Returns:

String:

The version number as a string or null

addVersion

(
  • url
  • version
)
public

Defined in addVersion:126

Add a version number for a file

Parameters:

  • url String

    The url of the object

  • version String

    Version number or has of file

addVersionsFile

(
  • url
  • callback
  • baseUrl
)
public

Defined in addVersionsFile:68

Add the versions

Parameters:

  • url String

    The url of the versions file

  • callback Function

    Callback when the url has been laoded

  • baseUrl String

    A base url to prepend all lines of the file

destroy

() public

Defined in destroy:58

Destroy the cache manager, don't use after this

initialize

() public

Defined in initialize:39

The constructor for the Cache manager

prepare

(
  • url
  • applyBasePath
)
String public

Defined in prepare:160

Prepare a URL with the necessary cache busting and/or versioning as well as the base directoryr

Parameters:

  • url String

    The url to prepare

  • applyBasePath Bool

    If the global base path should be applied to the url. This defaults to false because it can potentially interfere with later regular expression checks, particularly with PreloadJS

Returns:

String:

The final url with version/cache and basePath added

Properties

_versions

Dictionary protected

Defined in _versions:24

The collection of version numbers

cacheBust

Bool public

Defined in cacheBust:31

If we are suppose to cache bust every file

Default: false