读书人

用webmachine 的缓存 是如斯简单

发布时间: 2012-10-13 11:38:17 作者: rapoo

用webmachine 的缓存 是如此简单

HTTP Caching Support

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>

读书人网 >Web前端

热点推荐