reinert / requestor

Request like a boss. 😎
Apache License 2.0
61 stars 8 forks source link

New request option: cache(long ttl) #144

Open reinert opened 1 year ago

reinert commented 1 year ago

If the user sets a request to be cached, then Requestor should save the Response object returned for the URI that was requested.

By default, only the successful request should be cached, but we should allow the user to set any status to be cached as well, with an argument.

Under the hood, we will save the response object with the URI string as the key (maybe prefixed with cache:) in the parent store of the request. Optionally we can allow to save in the root store.