Skip to content
pCon.configurator onlineDocumentation
Esc
↑↓navigate↵open⌘Jpreview
On this page

Support for response headers

Synopsis

egr.eai.http.response_headers==<path pattern: HTTP response header field>

Default Value: empty

The option value consists of a path pattern and a HTTP response header field, separated by a path separator character (semicolon (U+003B) on Windows and semicolon or colon (U+003A) on Unix-like systems).

The path consists of a non-empty prefix and a possibly empty pattern (even though an empty pattern doesn’t make much sense as of now as URLs ending with a slash produce a 404 Not Found response).

The path prefix consists of the longest sequence of characters other than asterisk (*, U+002A) starting and ending with a slash (/). The path prefix must literally match the beginning of an URL path.

The pattern consists of a sequence of characters other than asterisk (which must literally match a corresponding characters in the URL path), interspersed by zero or more sequences of one or more asterisk. A single asterisk matches a sequence of zero or more characters other than slash, whereas a sequence of two or more asterisks matches a possibly empty sequence of any character.

The response header field consists of field name and file value according to RFC 9112, Section 5, Field Syntax.

The field name must match one of the supported field names (ignoring case), and the field value must conform to the rules for that field name.

The only field name currently supported is Cache-Control. The rules for the field value are defined in RFC 9111, Section 5.2, Cache Control, Subsection 5.2.2, Response Directives. In case of different rules for sender and receiver, the rules for senders apply.

The startup file may contain multiple egr.eai.http.response_headers option lines. The effective line is determined as follows:

  • Only lines whose path prefix and pattern match the normalized path component of the request URL are considered.
  • Lines with a longer matching path prefix take precedence over lines with a shorter matching path prefix.
  • If there are multiple matching lines with equal path prefix but different patterns, the line that appears last in the startup file is used.

Example:

egr.eai.http.response_headers=/**:Cache-Control: public, max-age=3600
egr.eai.http.response_headers=/session-cache/**:Cache-Control: public, max-age=86400
egr.eai.http.response_headers=/OFML/**:Cache-Control: public, max-age=2592000

Examples for paths:

Path pattern Description
/prefix/*.foo All files ending with .foo in directory /prefix/ (but not in subdirectories of /prefix/)
/prefix/**.foo All files ending with .foo in directory /prefix/ and subdirectories of /prefix/ at any depth.
/prefix/**/*.foo All files ending with .foo in subdirectories of /prefix/ at any depth.
/prefix/*/*.foo All files ending with .foo in immediate subdirectories of prefix.