From aded6f9dbcd6559f55c1f71969b9aeb70955e929 Mon Sep 17 00:00:00 2001
From: Michael Jackson
If you omit the file path (i.e. use a “bare” URL), unpkg
will serve the file specified by the unpkg
field in{' '}
- package.json
, or fall back to{' '}
- main
.
+ package.json
, or fall back to main
.
@@ -248,16 +247,24 @@ export default class App extends React.Component {
authors to overwrite a package that has already been published with a
different one at the same version number.
+ Browsers are instructed (via the Cache-Control
header) to
+ cache assets indefinitely (1 year).
+
URLs that do not specify a package version number redirect to one that
does. This is the latest
version when no version is
specified, or the maxSatisfying
version when a{' '}
semver version is
- given. Redirects are cached for 5 minutes.
+ given. Redirects are cached for 10 minutes at the CDN, 1 minute in
+ browsers.
- Browsers are instructed (via the Cache-Control
header) to
- cache assets for 1 year.
+ If you're you want users to be able to use the latest version
+ when you cut a new release, the best policy is to put the version
+ number in the URL directly in your installation instructions. This
+ will also load more quickly because we won't have to resolve the
+ latest version and redirect them.
package.json
+ in package.json