Skip to content

Commit

Permalink
Add README explination
Browse files Browse the repository at this point in the history
  • Loading branch information
smyrick committed Aug 19, 2022
1 parent e383f50 commit e6cda22
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/apollo-datasource-rest/README.md
Expand Up @@ -70,10 +70,10 @@ class MoviesAPI extends RESTDataSource {
```

#### `requestCacheEnabled`
By default, `RESTDataSource` caches all outgoing GET **requests** in a separate memoized cache from the regular response cache. It does this to prevent duplicate calls that might happen in rapid succession.
If a request is made with the same cache key (URL by default) with an HTTP method other than GET, the cached request is then cleared.
By default, `RESTDataSource` caches all outgoing GET **requests** in a separate memoized cache from the regular response cache. It makes the assumption that all responses from HTTP GET calls are cacheable by their URL.
If a request is made with the same cache key (URL by default) but with an HTTP method other than GET, the cached request is then cleared.

If you would like to disable the GET request cache, set the `requestCacheEnabled` property to `false`.
If you would like to disable the GET request cache, set the `requestCacheEnabled` property to `false`. You might want to do this if your API is not actually cacheable or your data changes over time.

```js title="requestCacheEnabled.js"
class MoviesAPI extends RESTDataSource {
Expand Down

0 comments on commit e6cda22

Please sign in to comment.