Re: "Text-Only" Versions Considered Harmful

> 
> Again, this is not an argument, because it is not necessarily the case. A
> site where a users preference for the text only view is retained in a cookie
> (as the next version of Betsie will... :) will not suffer from this.

Cookies for static page selection are cache unfriendly.  One of the reasons
that I will go for the text only version of a page, if offered (and if
the link has not been made invisible, or virtually so, in graphics mode)
is that they are much faster to navigate.  Forcing an access to the
server every time destroys quite a bit of that performance benefit.

If you do go this way, make sure that you have an Expires header to
disable caching for HTTP 1.0 browsers and:

- try to ensure that there are no other cookies on the site;
- use exactly the same cookie - don't use session IDs;
- include a Vary: header to tell caches that the contents depends on the cookie.

All this must be done with real HTTP headers, not meta, as public caches
don't look at meta.  There may be something else you need to set to 
prevent caches taking the presence of a cookie as a 'don't cache' 
indicator.

Note that Vary fails degraded on many caches in that they treat the page
as uncacheable, rather than conditionally cacheable.  It is generally better
to redirect to a completely static page when content negotiating like this,
unless the page is small.

If, for some reason, you can't set Vary, but can set Cache-Control, you should
set Cache-Control: private, so that the browser is allowed to cache the pages
but nothing else is.

This assumes that you meet other cacheability criteria.

Received on Saturday, 17 February 2001 06:31:14 UTC