用webmachine 的缓存 是如此简单
HTTP caching support is also quite easy, with functions allowing resources to define (e.g.)?last_modified
,?expires
, and?generate_etag
. For instance, since representations of this resource vary only by URI Path, I could use an extremely simple entity tag unfit for most real applications but sufficient for this example:
HTTP/1.1 200 OKVary: AcceptServer: MochiWeb/1.1 WebMachine/0.97Expires: Fri, 01 Jan 2021 00:00:00 GMTETag: /demo/authdemoDate: Sun, 15 Mar 2009 02:59:02 GMTContent-Type: text/htmlContent-Length: 59<html><body>Hello authdemo from Webmachine.</body></html>