From 05b591291273f7f4da65616dddab59f42eaaf2a4 Mon Sep 17 00:00:00 2001 From: Matthew King Date: Thu, 16 Jul 2015 00:37:41 -0700 Subject: [PATCH] Clarify precondition for freshness check I ran into the issue from #294 and thought it was a bug since fresh was always returning false. I think it's fair that, at the very least, the docs are not completely clear on how to use `this.fresh`. --- docs/api/request.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/api/request.md b/docs/api/request.md index 1d39e61..a73b2c6 100644 --- a/docs/api/request.md +++ b/docs/api/request.md @@ -130,6 +130,8 @@ this.query = { next: '/login' }; method is for cache negotiation between `If-None-Match` / `ETag`, and `If-Modified-Since` and `Last-Modified`. It should be referenced after setting one or more of these response headers. ```js +// freshness check requires status 20x or 304 +this.status = 200; this.set('ETag', '123'); // cache is ok