To properly send 304's, the RFC (2616) says:
The 304 response MUST NOT contain a message-body, and thus is
always terminated by the first empty line after the header fields.
So I needed a way to do this, and created it.
Anyone prefer to see a different name?
Using this, one can do something along these lines:
hgetvars
headers set "Last-Modified" "$ENVS(LAST_MODIFIED)"
if { [ info exists ENVS(If-Modified-Since) ] } {
if { $ENVS(LAST_MODIFIED) == $ENVS(If-Modified-Since) } {
headers numeric 304
no_body
return 0
}
}
This allows proxies and stuff to cache data.
Why would you want to do this?
Some pages are not truly 'dynamic' content, but 'semi-dynamic', and
could actually be cached. tcl.apache.org is a pretty good example of
this:-)
Naturally, care needs to be taken that it is indeed possible to cache
the content, and that nothing has changed (if there is an 'include'
file, for instance, it needs to be taken into consideration).
Thoughts? Comments?
--
David N. Welton
Personal: http://www.efn.org/~davidw/
Free Software: http://people.debian.org/~davidw/
Apache Tcl: http://tcl.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]