| 发表于:2007-05-06 17:24:0913楼 得分:0 |
http://code.knowsky.com/down/14.html是动态页面,这是它的mime头 date: sun, 06 may 2007 09:10:01 gmt server: microsoft-iis/6.0 content-length: 35454 content-type: text/html set-cookie: aspsessionidcscqrtcc=ihjdfjhbibgddfofibnkdokb; path=/ cache-control: private 静态页面的mime头是这样的 server: microsoft-iis/6.0 date: sun, 06 may 2007 09:12:05 gmt content-type: text/html accept-ranges: bytes last-modified: sat, 05 may 2007 10:09:12 gmt etag: "4657bd6dfd8ec71:1545 " content-length: 12968 静态页与动态页的mime有个区别就是last-modified,如果动态页不用response.addheader添加这个mime头,那么它是不会有的,静态页面一定会带上这个mime头,它表示文件最后更新时间 可以用这种方法来达到你要的效果: 1、你用isapi rewrite来虚拟一个url,使其看上去象静态页,但实际是动态的,isapi rewrite的资料可以去google一下,这里不多写。假设把http://www.com/test/1.html重写到http://www.com/test.asp?id=1 2、test.asp里,根据id把页面缓存到文件中,然后写一个文件判断,如果已经缓存,则读取文件,如果没缓存,那么生成缓存,生成缓存的时候,可以将排行做成html备注,例如: <!--这是本月排行--> 3、读取缓存文件后,搜索字符串: <!--这是本月排行--> 。如果找到,则替换它为本月的排行 | | |
|