|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
<cfheader> and caching
I'm trying to keep my pages from caching in visitors browsers and/or proxyjmauney 06/23/03 04:57 P I found this somewhere and put it in my cfapplication and it seems tojeremy 06/23/03 05:04 P > <CFSET gmt = gmt.utcHourOffset>Paul Hastings 06/23/03 09:57 P I included them in the application.cfm of a site (maybe not a best practice,Ben Doom 06/23/03 05:08 P Yes, these seem to work very reliably. Unlike cfhtmlhead, they don'tMatthew Walker 06/23/03 05:37 P I'm trying to keep my pages from caching in visitors browsers and/or proxy servers. I found the following code online that uses cfheader: <CFHEADER NAME="Expires" VALUE="Mon, 06 Jan 1990 00:00:01 GMT"> <CFHEADER NAME="Pragma" VALUE="no-cache"> <CFHEADER NAME="cache-control" VALUE="no-cache"> Do I have to put that code in the <head></head> section of my pages, or can it just go at the top? Can I put it in my Application.cfm file? Should I bother with META tags too? Has anyone had any experiences with this that could be helpful? Thanks, Jonathan ________________________________________________________ Jonathan Mauney Manager, Digital Media Properties / Web Application Developer 1110 WBT AM / 107.9 the LINK (WLNK-FM) / Jefferson-Pilot Radio Network Jefferson-Pilot Communications Co. One Julian Price Place Charlotte, North Carolina 28208 I found this somewhere and put it in my cfapplication and it seems to work. The cfapplication would be the way to go I would think. <CFSET gmt = gettimezoneinfo()> <CFSET gmt = gmt.utcHourOffset> <CFIF gmt EQ 0> <CFSET gmt = ""> <CFELSEIF gmt GT 0> <CFSET gmt = "+" & gmt > </CFIF> <CFHEADER NAME="Pragma" VALUE="no-cache"> <CFHEADER NAME="Cache-Control" VALUE="no-cache, must- revalidate"> <CFHEADER NAME="Last-Modified" VALUE="#DateFormat(now (), 'ddd, dd mmm yyyy')# #TimeFormat(now(), 'HH:mm:ss')# GMT#gmt#"> <CFHEADER NAME="Expires" VALUE="Mon, 26 Jul 1997 05:00:00 GMT"> JLB I'm trying to keep my pages from caching in visitors browsers and/or proxy servers. I found the following code online that uses cfheader: <CFHEADER NAME="Expires" VALUE="Mon, 06 Jan 1990 00:00:01 GMT"> <CFHEADER NAME="Pragma" VALUE="no-cache"> <CFHEADER NAME="cache-control" VALUE="no-cache"> Do I have to put that code in the <head></head> section of my pages, or can it just go at the top? Can I put it in my Application.cfm file? Should I bother with META tags too? Has anyone had any experiences with this that could be helpful? Thanks, Jonathan ________________________________________________________ Jonathan Mauney Manager, Digital Media Properties / Web Application Developer 1110 WBT AM / 107.9 the LINK (WLNK-FM) / Jefferson-Pilot Radio Network Jefferson-Pilot Communications Co. One Julian Price Place Charlotte, North Carolina 28208 > <CFSET gmt = gmt.utcHourOffset> ----- Excess quoted text cut - see Original Post for more ----- not all timezones are hour offsets from GMT, you should also add utcMinuteOffset to your GMT. I included them in the application.cfm of a site (maybe not a best practice, but it was a post hoc fix) and it worked fine. I'll let others speak to the wisdom of that, though. Anyway, unless I've missunderstood, these send a HTTP response header, so they go out before the <head> block. IIRC, you have to put them within the first 4000 chars, but otherwise it doesn't really matter. In any case, I skipped the meta tags. No one has complained yet. -- Ben Doom Programmer & General Lackey Moonbow Software, Inc : -----Original Message----- : From: jmauney@jpc.com [mailto:jmauney@jpc.com] : Sent: Monday, June 23, 2003 4:54 PM : To: CF-Talk : Subject: <cfheader> and caching : : : I'm trying to keep my pages from caching in visitors browsers and/or proxy : servers. I found the following code online that uses cfheader: : : <CFHEADER NAME="Expires" VALUE="Mon, 06 Jan 1990 00:00:01 GMT"> : <CFHEADER NAME="Pragma" VALUE="no-cache"> : <CFHEADER NAME="cache-control" VALUE="no-cache"> : : Do I have to put that code in the <head></head> section of my : pages, or can : it just go at the top? Can I put it in my Application.cfm file? Should I : bother with META tags too? Has anyone had any experiences with this that : could be helpful? : : Thanks, : Jonathan : ________________________________________________________ : Jonathan Mauney : Manager, Digital Media Properties / Web Application Developer : 1110 WBT AM / 107.9 the LINK (WLNK-FM) / Jefferson-Pilot Radio Network : Jefferson-Pilot Communications Co. : One Julian Price Place : Charlotte, North Carolina 28208 : : : Yes, these seem to work very reliably. Unlike cfhtmlhead, they don't translate into HTML tags but rather appear in the header block with the cookies and other whatnot, so you don't need to put them in your head. You do need to put them near the top of your doc, so Application.cfm would work out fine. Matthew Walker Electric Sheep Web http://www.electricsheep.co.nz/ ----- Excess quoted text cut - see Original Post for more ----- can ----- Excess quoted text cut - see Original Post for more -----
|
September 09, 2010
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||