|
@@ -6,14 +6,16 @@ permalink: docs/golden-retriever/
|
|
order: 71
|
|
order: 71
|
|
---
|
|
---
|
|
|
|
|
|
-The `@uppy/golden-retriever` plugin saves selected files in your browser cache, so that if the browser crashes, Uppy can restore everything and continue uploading like nothing happened. Read more about it [on the blog](https://uppy.io/blog/2017/07/golden-retriever/).
|
|
|
|
|
|
+The `@uppy/golden-retriever` plugin saves selected files in your browser cache, so that if the browser crashes, Uppy can restore everything and continue uploading as if nothing happened. You can read more about it [on our blog](https://uppy.io/blog/2017/07/golden-retriever/).
|
|
|
|
|
|
-The Golden Retriever uses LocalStorage to store file metadata and Uppy state, and IndexedDB for small files. It also uses a Service Worker for _all_ files—unlike IndexedDB, a Service Worker can keep very large files. Service Worker storage is _very_ temporary though, and doesn't persist across browser crashes or restarts. It works very well for accidental refreshes or closed tabs.
|
|
|
|
|
|
+The Golden Retriever uses LocalStorage to store file metadata and Uppy state, and IndexedDB for small files. It also uses a Service Worker for _all_ files because, unlike IndexedDB, a Service Worker can keep very large files. Service Worker storage is _very_ temporary though, and doesn't persist across browser crashes or restarts. It works very well, however, for accidental refreshes or closed tabs.
|
|
|
|
|
|
## Installation
|
|
## Installation
|
|
|
|
|
|
This plugin is published as the `@uppy/golden-retriever` package.
|
|
This plugin is published as the `@uppy/golden-retriever` package.
|
|
|
|
|
|
|
|
+Install from NPM:
|
|
|
|
+
|
|
```shell
|
|
```shell
|
|
npm install @uppy/golden-retriever
|
|
npm install @uppy/golden-retriever
|
|
```
|
|
```
|
|
@@ -26,7 +28,7 @@ const GoldenRetriever = Uppy.GoldenRetriever
|
|
|
|
|
|
## Usage
|
|
## Usage
|
|
|
|
|
|
-1\. Bundle your own service worker `sw.js` file with Uppy GoldenRetriever’s service worker. If you’re using Browserify, just bundle it separately, for Webpack there is a plugin [serviceworker-webpack-plugin](https://github.com/oliviertassinari/serviceworker-webpack-plugin).
|
|
|
|
|
|
+1\. Bundle your own service worker `sw.js` file with Uppy GoldenRetriever’s service worker. If you are using Browserify, just bundle it separately. For Webpack, there is a plugin [serviceworker-webpack-plugin](https://github.com/oliviertassinari/serviceworker-webpack-plugin).
|
|
|
|
|
|
```js
|
|
```js
|
|
// sw.js
|
|
// sw.js
|
|
@@ -54,4 +56,4 @@ if ('serviceWorker' in navigator) {
|
|
}
|
|
}
|
|
```
|
|
```
|
|
|
|
|
|
-Voila, that’s it. Happy retrieving!
|
|
|
|
|
|
+Voilà, that’s it. Happy retrieving!
|