cfheader

Description

Generates custom HTTP response headers to return to the client.

Category

Page processing tags

Syntax

<cfheader 
  name = "header_name"
  value = "header_value">
or
<cfheader 
  statusCode = "status_code"
  statusText = "status_text"> 

See also

cfcache, cfflush, cfheader, cfhtmlhead, cfinclude, cfsetting, cfsilent

Attributes

Attribute
Description
name
Required if you do not specify the statusCode attribute. A name for the header.
value
Optional. A value for the HTTP header. This attribute is used in conjunction with the name attribute.
statusCode
Required if you do not specify the name attribute. A number that sets the HTTP status code.
statusText
Optional. Text that explains the status code. This attribute is used in conjunction with the statusCode attribute.

Example

<!--- This example shows the use of cfheader --->
<html>
<head>
<title>cfheader Example</title>
</head>

<body>
<H3>cfheader Example</H3>

<P>cfheader generates custom HTTP response headers
to return to the client. 
<P>The following example forces the browser client
to purge its cache of a requested file. 
<cfheader name = "Expires" value = "#Now()#">

</body>
</html>