CacheManager Class
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.
Item Index
Methods
_getVersionByUrl
-
url
Search for a version number by url
Parameters:
-
url
StringThe url to search
Returns:
The version number as a string or null
addVersion
-
url
-
version
Add a version number for a file
addVersionsFile
-
url
-
callback
-
baseUrl
Add the versions
destroy
()
public
Destroy the cache manager, don't use after this
initialize
()
public
The constructor for the Cache manager
prepare
-
url
-
applyBasePath
Prepare a URL with the necessary cache busting and/or versioning as well as the base directoryr
Parameters:
-
url
StringThe url to prepare
-
applyBasePath
BoolIf 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:
The final url with version/cache and basePath added
Properties
_versions
Dictionary
protected
The collection of version numbers
cacheBust
Bool
public
If we are suppose to cache bust every file
Default: false