Test Http_AddHeader

[Template_Dynamic set sock [Httpd_CurrentSocket] #Http_RemoveHeaders $sock ;# remove any user-defined headers Http_AddHeaders $sock Cache-Control no-cache ;# should prevent caching Http_AddHeaders $sock Warning {199 localhost "User Warning"} ;# does nothing set freq 3 Http_AddHeaders $sock Refresh $freq return "" ]

# Test Http_AddHeaders [clock format [clock scan now]]

This document uses Http_AddHeaders to set the http 'Cache-Control: no-cache' header in a reply

It also uses Http_AddHeaders to set the http 'Refresh:' header, which causes a reload every $freq seconds

## Use of Http_AddHeaders

Http_AddHeaders sock header value ... can be called any time before returning data to httpd, and will cause the headers to be added to the http HEAD section of tclhttpd's reply to the client browser, in sequence before any cookies.

Http_RemoveHeaders sock {pattern} ... can be called any time before returning data to httpd, and will remove any headers matching pattern (default all) from a previously user-supplied header set.

## Utility wrappers

Http_NoCache sock adds a header cache directive to prevent caching.

Http_Refresh sock time {url} adds a header cache directive to refresh after time seconds to the given url (default same url).

Here are some response headers from the RFC 2616. I have no idea what any of them do.

- Cache-Control
- Accept-Ranges
- Age
- ETag
- Location
- Proxy-Authenticate
- Retry-After
- Server
- Vary
- WWW-Authenticate
- Allow
- Content-Encoding
- Content-Language
- Content-Length
- Content-Location
- Content-MD5
- Content-Range
- Content-Type
- Expires
- Last-Modified

Last modified: Mon Oct 27 11:52:36 EST 2003