;中国 COLD FUSION 用户组; WWW.CFWINDOW.COM 
您的位置 :首页 >> CF 技巧文章 >> 阅读文章内容 [ 关闭窗口 ]      

技巧文章内容 
    怎样防止用户的浏览器自动读取Cache的内容.
文章作者 : Linkfoxo [ linkfoxo@yahoo.com ]          Web URL : http://www.cfwindow.com
上载日期 : 2000-11-23

这个问题也是老生常谈了,在前面的文章提过.

This question comes up a lot on lists and various forums, so
I figured I would pass it along. To prevent a page from being
cached-to-disk (i.e., after a session expires, the user can't
click the 'Back' button to view any data), you need to use
either META tags or CFHEADER (my preferred
method), or both.

Put the following tags at the top of the page
you do not want cached:
    
<CFHEADER NAME="Expires" VALUE="Tue, 01 Jan 1985 00:00:01 GMT">
<CFHEADER NAME="Pragma" VALUE="no-cache">
<CFHEADER NAME="cache-control"
VALUE="no-cache, no-store, must-revalidate">

If you don't want ANY pages cached within your application,
simply put them in your Application.cfm file. If you're using
FuseBox, you can put these in the App_Server.cfm or
App_Globals.cfm file or, if you want it for only one
circuit app, put them in the App_Locals.cfm file for that
circuit. If you're using CF_BodyContent, these should be
placed above it.

If you prefer to use META tags, here is the syntax:

<META HTTP-EQUIV="Expires"
CONTENT="Tue, 01 Jan 1985 00:00:01 GMT">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="cache-control"
CONTENT="no-cache, no-store, must-revalidate">
    
Caveat: some browsers do not properly understand header
responses, and some servers have them turned off. The best way
to know is to simply try it. Also, some firewalls will strip
the headers created by CFHEADER, so in certain situations you
may need to use CFHEADER and META tags simultaneously.







< 联系我们 --- 中国Cold Fusion用户组>

CFUG 国内(总部):Linkfoxo    上海:CFANS    北京:Cafe,Cyberkid,liwater    沈阳:Wangking
  
哈尔滨:Baiming    浙江:梅盛松    江西:陈末
  
CFUG (国际) Nagoya(名古屋):Codeguru    新加坡:YUZI    新西兰(Auckland):Richard CHEN
Copyright 2000-2001 www.cfwindow.com.All rights reserved

;中国 COLD FUSION 用户组; WWW.CFWINDOW.COM