首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

用webmachine 的缓存 是如斯简单

2012-10-13 
用webmachine 的缓存 是如此简单HTTP Caching SupportHTTP caching support is also quite easy, with fun

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

热点排行