Hey Dude,
Unfortunately HTTP caching takes a lot more consideration than just
globally setting a custom HTTP response header.
When you set a custom header for caching purposes, this process is
entirely dependent on receiving some specific request HTTP header
properties (i.e., If-Modified-Since and/or If-None-Match), in order to
conditionally set a corresponding expiry date, an ETag number and a
304 response (for the subsequent responses), as opposed to the custom
200 response (on the first response). And depending on the version of
tango you are running - you may not have access to these HTTP
properties.
In addition, HTTP caching is managed by matching the entire URL of the
file in question, this includes the argument names and values, so if
your GET arguments are changing, then your caching is overridden. POST
requests generally always override cache checks as well.
And of course it should be mentioned that although browsers and
proxies do adhere to the HTTP standards, these applications and
devices are sometimes unpredictable as to "when" they implement cache
rules.
I've built systems with HTTP caching, and I hope I can save you some
time by giving you some advice - don't bother. The headache,
unpredictability and limited results is usually not worth it. There'll
be times where you can easily waste hours chasing your code in circles
just to discover that all the bugs and weird behavior is the result of
something happening off the server (where you have no control).
I would recommend you pursue methods for caching whatever essential
data you need in memory on the Server to save on performance issues -
or check out load balancing. Or possibly an appliance of some kind
that handles the caching outside of your server.
And please note, your tango code example is for deliberately turning
"off" caching.
I hope this helps, good luck.
Scott,
On Aug-22-2008, at 10:55 AM, WebDude wrote:
Hi All,
I am a bit confused as to how to implement a caching scheme in which
I can show whether or not a page has been updated or not. This is
for a forum that stores the last update by date. I would like to
change the response http to show the last-modified date if possible.
Unfortunately, I am a novice on http headers and would like some
help on how to implement this. If I set the expiry to
<@ASSIGN Local$httpHeader VALUE="Content-Type: text/html<@CRLF>Cache-
Control: no-cache, max-age=0, must-revalidate,proxy
revalidate<@CRLF>Pragma: no-
cache<@CRLF><@USERREFERENCECOOKIE><@CRLF>">
Will this generat what I need for the request? I am looking for the
reponse to be something like this...
HTTP/1.0 200 OK
Server: Microsoft-IIS/5.0
Content-Location: http://www.xyz.taf
Date: Fri, 22 Aug 2008 18:22:39 GMT
Content-Type: text/html
Accept-Ranges: bytes
Last-Modified: Wed, 020 Aug 2008 13:30:23 GMT
ETag: "801395163ec21:8a9"
Content-Length: 751
And I am confused as to the ETag.
Can I set this globally for all tafs? or would that really take a
performance hit?
Can someone shed some light on this, please?
Thanks!
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf