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`.
This commit is contained in:
Matthew King 2015-07-16 00:37:41 -07:00
parent a8689e4e41
commit 05b5912912

View file

@ -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