The mgiSetResponseHeader Tag

Tag Behavior

Use the mgiSetResponseHeader tag to create a header with a specified value in the HTTP response of the page.

Tag Syntax

The mgiSetResponseHeader tag has a beginning tag with one required parameter and no optional parameters, a body, and an ending tag. The tag form is:

<mgiSetResponseHeader name="Name">
Header Value

Required Parameters:

  • name - The name is the name of the header that is created.

Optional Parameters:

  • None

Example Usage and Output

<mgiSetResponseHeader name="Cache-Control">

In this example, a Cache-Control header is added to the page to eliminate caching from proxy servers, etc.

<mgiSetResponseHeader name="Content-Type">

In this example, the Content-Type header of the page is changed to image/jpeg. This provides a way to override the default Content-Type that MGI returns.

Suggested Usage

  • Cache Control
  • Custom Content Types

[Understanding MGI Menu] [Using MGI Menu] [Referencing MGI Menu]

[MGI Guides Main Menu] [User Guide Main Menu]