AppCache Plugin v3.0.0 - BRJS 1.0 Compatibility
Changes to make the plugin compatible with BRJS 1.0 plugin API changes.
- The version is now configured via the internal BRJS version rather than a separate config file. See below for usage.
- The tokens
$timestamp
and$brjsVersion
are no longer needed or supported as the BRJS model version already provides this.
Usage
Quick start
- Download the latest
appcache-plugin.jar
at https://github.com/BladeRunnerJS/brjs-appcache/releases - Copy the plugin JAR to the BRJS
conf/java
folder. - Add the appcache plugin tag to your HTML element e.g.
<html manifest="<@appcache.url@/>">
Usage
Installation
- Copy the plugin JAR to the BRJS
conf/java
folder.
Enabling
- The plugin provides the
appcache.url
tag handler. This tag will replaced with the URL to the manifest file, so you should set themanifest
attribute on thehtml
element to use the tag as its value.- To do this change the
html
element to<html manifest="<@appcache.url@/>">
- To do this change the
Configuration
- By default the appcache is disabled in 'dev' and a URL that returns a 404 response will be used to disable the cache
- The appcache version is configured via the
BRJS
version property. - To enable the appcache in 'dev' the version should be changed to a numbered version. To do this run the
serve
command
with the 'version' argument, for examplebrjs serve -v 1.2.3
. A timestamp will be appended to the
version to ensure versions are unique.- The timestamp is calculated when the serve is started and will not
change on subsequent reloads. This is to ensure the version remains static in the manifest as browser's
will throw an exception is the manifest file changes while assets are being downloaded. To change the version
the server will need to be restarted for a new timestamp to be generated.
- The timestamp is calculated when the serve is started and will not
- When building an app for production the version can be supplied via the 'version' argument, for example
brjs build-app foo -v 1.2.3
.
As with the serve command a timestamp is also appended to this version.