Skip to content

Get requests that return errors other than 500 are being cached  #74

@emcpadden

Description

@emcpadden

I had a get request that returned a status of 503 and that result was being cached.

When I debugged into the code i could see that in cache-encoder.js it was only looking for statusCodes !== 500 to determine whether the result was cacheable:

exports.cache = function(statusCode, headers, content, cb) {
  var buffer;
  if (statusCode && statusCode !== 500 && (headers || content)) {

I would think that it should only cache statuses between >= 200 and < 300.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions