Skip to content

Commit

Permalink
Merge pull request #593 from storyblok/task/int-926
Browse files Browse the repository at this point in the history
task(int-926): Update docs for cache and proxy
  • Loading branch information
ademarCardoso authored Jun 26, 2023
2 parents d0a8061 + 5813d24 commit 7dfdd54
Showing 1 changed file with 2 additions and 22 deletions.
24 changes: 2 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ We added retro-compatibility when using `resolve_assets: 1` parameter under V2.

The Storyblok client comes with a caching mechanism.
When initializing the Storyblok client you can define a cache provider for caching the requests in memory.
To clear the cache you can call `Storyblok.flushCache()` or activate the automatic clear with clear: 'auto'.

The default behavior of the cache is `clear: 'manual'`, that is, if you need to clear the cache, you need to call `Storyblok.flushCache()` or activate the automatic clear with `clear: 'auto'`, as in the example below.

```javascript
let Storyblok = new StoryblokClient({
Expand Down Expand Up @@ -554,27 +555,6 @@ let getStories = (page) => {
getStories(1);
```

#### Initialize with a proxy server

```javascript
const proxy = {
host: host,
port: port,
auth: {
username: 'username',
password: 'password'
}
}

const storyblok = new StoryblokClient({
...
https: false,
proxy: proxy
})
```

Read more about proxy settings in axios [documentation](https://github.com/axios/axios)

#### How to define a custom schema for the RichTextRenderer

To define how to add some classes to specific html attributes rendered by the rich text renderer, you need your own schema definition. With this new schema, you can pass it as the `richTextSchema` option when instantiate the `StoryblokClient` class. You **must** follow the [default schema](https://github.com/storyblok/storyblok-js-client/blob/main/src/schema.ts) to do this.
Expand Down

0 comments on commit 7dfdd54

Please sign in to comment.