uriVersionPrefix property
String
uriVersionPrefix
The prefix used to denote a different version of JavaScript or Dart code,
- such that the browser will reload the JavaScript files automatically.
- It will be removed before the URI mapping and it is not visible to
- the request handler. For example, you can generate the JavaScript link as
- follows in RSP:
-
<script src="[=connect.server.uriVersionPrefix]/js/init.js"></script>
- Then, no matter the value of uriVersionPrefix, the file at
/js/init.js
- will always be loaded.
-
Default: "" (no special prefix at all). Notice the value must start
- with
"/"
. - ##Typical Use
- You usually assign a build number to it when the server is restarted:
-
server.uriVersionPrefix = "/$buildNumber";
- Then, the browser will reload the JavaScript code automatically each
- time the build number is changed.
- You can prefix it to the image that depends on the build number too.
Implementation
String get uriVersionPrefix;
Sets the version prefix.
Implementation
void set uriVersionPrefix(String uriVersionPrefix);