Skip to content
This repository has been archived by the owner on Jun 12, 2022. It is now read-only.

Commit

Permalink
fix(cache): only cache 200 gets
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Mar 31, 2017
1 parent a12eab0 commit 0abb25a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ function remoteFetch (uri, opts) {
req.method.toLowerCase() === 'get' &&
opts.cache &&
opts.cacheMode !== 'no-store' &&
res.status < 300 &&
res.status >= 200
// No other statuses should be stored!
res.status === 200
) {
return opts.cache.put(req, res, opts.cacheOpts)
} else if (req.method.toLowerCase() !== 'post' && res.status >= 500) {
Expand Down

0 comments on commit 0abb25a

Please sign in to comment.