Skip to content

Commit 4912d4c

Browse files
authored
📝 Update README.md (#77)
Make it clear that throttling only applies to GET.
1 parent e5fec2a commit 4912d4c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ A non-invasive, simple, reliable collection of axios extension
1313
*Not working with axios v0.19.0 as its custom config bug, See https://github.com/axios/axios/pull/2207.*
1414

1515
* [cacheAdapterEnhancer](#cacheadapterenhancer) makes request cacheable
16-
* [throttleAdapterEnhancer](#throttleadapterenhancer) makes request throttled automatically
16+
* [throttleAdapterEnhancer](#throttleadapterenhancer) makes GET requests throttled automatically
1717
* [retryAdapterEnhancer](#retryadapterenhancer) makes request retry with special times while it failed
1818

1919
## Installing
@@ -164,7 +164,7 @@ http.get('/users', { cache: cacheA, forceUpdate: true });
164164

165165
### throttleAdapterEnhancer
166166

167-
> Throttle requests most once per threshold milliseconds
167+
> Throttle GET requests most once per threshold milliseconds
168168
169169
```ts
170170
throttleAdapterEnhancer(adapter: AxiosAdapter, options: Options): AxiosAdapter
@@ -178,6 +178,7 @@ Where `adapter` is an axios adapter which following the [axios adapter standard]
178178
| cache | CacheLike |<pre>new LRUCache({ max: 10 })</pre> | CacheLike instance that will be used for storing throttled requests |
179179

180180
Basically we recommend using the `throttleAdapterEnhancer` with `cacheAdapterEnhancer` together for the maximum caching benefits.
181+
Note that POST and other methods besides GET are not affected.
181182

182183
```js
183184
throttleAdapterEnhancer(cacheAdapterEnhancer(axios.defaults.adapter))

0 commit comments

Comments
 (0)