cfheader

Description

Generates custom HTTP response headers to return to the client.

Category

Data output tags, Page processing tags

Syntax

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

See also

cfcache, cfflush, cfhtmlhead, cfinclude, cfsetting, cfsilent

Attributes

Attribute Req/Opt Default Description
name
Required if statusCode not specified
 
Header name
value
Optional
 
HTTP header value
statusCode
Required if name not specified
 
Number. HTTP status code
statusText
Optional
 
Explains status code

Usage

If you use this tag after the cfflush tag on a page, an error is thrown.

Example

<h3>cfheader Example</h3>

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

Comments