diff --git a/lib/index.js b/lib/index.js index 97466e4..30d30b1 100644 --- a/lib/index.js +++ b/lib/index.js @@ -30,8 +30,11 @@ function cache (config = {}) { const uuid = key(req) - // clear cache if method different from GET - if (req.method.toLowerCase() !== 'get') { + // clear cache if method different from GET. + // We should exclude HEAD + const method = req.method.toLowerCase() + + if (method !== 'get' || method !== 'head') { config.store.removeItem(uuid) return null }