I'm working on support for Conditional GET in a large web-app. Currently our dynamic pages are marked as uncacheable, so they get reloaded on every view; but I'm putting in Last-Modified: and ETag: headers that reflect the content's mod date and user view settings, so we can respond to later requests with a quick 304 Not Modified if the page is still up-to-date.
The problem is that Safari [actually CFNetwork] doesn't send the eTag in its conditional GETs. That is, it sends an If-Modified-Since: header but not an If-None-Match:, so we can only use the mod date, and not the eTag, for deciding whether to send a 304 or a 200.
The reason this is a problem is that there are aspects of the response that are determined not by the page content's mod date, but by session-specific settings like the user name and localization. These can be captured in an eTag value, but not in a last-modified date. So without the client's eTag, we can't correctly determine whether the cached page is valid, and the user might see stale content after logging in or out, or changing her settings.
I've found some archived emails (like Safari bug reports) that indicate that this is already a known CFNetwork issue. Is there any workaround? Is anyone allowed to venture a guess whether this might be patched in a Safari maintenance update, or an OS software update, or not till Safari 4 / 10.6?
—Jens |