Skip to content

Commit

Permalink
refactor: added caching (#219)
Browse files Browse the repository at this point in the history
* refactor: added caching

* refactor: added example of cache recovering

* refactor: bee-js updated

* refactor: added retry param for browser tests

* refactor: added node version for the web tests

* refactor: added node 18 support

* refactor: removed node 18 support
  • Loading branch information
IgorShadurin authored Mar 1, 2023
1 parent 8da1495 commit 9997e63
Show file tree
Hide file tree
Showing 26 changed files with 846 additions and 237 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ jobs:
with:
fetch-depth: 1

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Auth to Github Package Docker Registry
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login https://docker.pkg.github.com -u ${GITHUB_ACTOR} --password-stdin
Expand Down
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,31 @@ await fdp.account.migrate('oldusername', 'oldpassword', {
})
```

Using FDP instance with cache

```js
const fdpCache = new FdpStorage('https://localhost:1633', batchId, {
cacheOptions: {
isUseCache: true,
onSaveCache: async cacheObject => {
const cache = JSON.stringify(cacheObject)
console.log('cache updated', cache)
},
}
})
```

Recovering FDP instance with saved cache

```js
const fdpCache = new FdpStorage('https://localhost:1633', batchId, {
cacheOptions: {
isUseCache: true,
}
})
fdpCache.cache.object = JSON.parse(cache)
```

## Documentation

You can generate API docs locally with:
Expand Down
Loading

0 comments on commit 9997e63

Please sign in to comment.