1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245
|
<pre>Network Working Group K. Holtman
Request for Comments: 2295 TUE
Category: Experimental A. Mutz
Hewlett-Packard
March 1998
<span class="h1">Transparent Content Negotiation in HTTP</span>
Status of this Memo
This memo defines an Experimental Protocol for the Internet
community. It does not specify an Internet standard of any kind.
Discussion and suggestions for improvement are requested.
Distribution of this memo is unlimited.
Copyright Notice
Copyright (C) The Internet Society (1998). All Rights Reserved.
ABSTRACT
HTTP allows web site authors to put multiple versions of the same
information under a single URL. Transparent content negotiation is
an extensible negotiation mechanism, layered on top of HTTP, for
automatically selecting the best version when the URL is accessed.
This enables the smooth deployment of new web data formats and markup
tags.
TABLE OF CONTENTS
<a href="#section-1">1</a> Introduction................................................<a href="#page-4">4</a>
<a href="#section-1.1">1.1</a> Background................................................<a href="#page-4">4</a>
<a href="#section-2">2</a> Terminology.................................................<a href="#page-5">5</a>
<a href="#section-2.1">2.1</a> Terms from HTTP/1.1.......................................<a href="#page-5">5</a>
<a href="#section-2.2">2.2</a> New terms.................................................<a href="#page-6">6</a>
<a href="#section-3">3</a> Notation....................................................<a href="#page-8">8</a>
<a href="#section-4">4</a> Overview....................................................<a href="#page-9">9</a>
<a href="#section-4.1">4.1</a> Content negotiation.......................................<a href="#page-9">9</a>
<a href="#section-4.2">4.2</a> HTTP/1.0 style negotiation scheme.........................<a href="#page-9">9</a>
<a href="#section-4.3">4.3</a> Transparent content negotiation scheme...................<a href="#page-10">10</a>
<a href="#section-4.4">4.4</a> Optimizing the negotiation process.......................<a href="#page-12">12</a>
4.5 Downwards compatibility with non-negotiating user agents.14
<a href="#section-4.6">4.6</a> Retrieving a variant by hand.............................<a href="#page-15">15</a>
<a href="#section-4.7">4.7</a> Dimensions of negotiation................................<a href="#page-15">15</a>
<span class="grey">Holtman & Mutz Experimental [Page 1]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-2" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
<a href="#section-4.8">4.8</a> Feature negotiation......................................<a href="#page-15">15</a>
<a href="#section-4.9">4.9</a> Length of variant lists..................................<a href="#page-16">16</a>
<a href="#section-4.10">4.10</a> Relation with other negotiation schemes.................<a href="#page-16">16</a>
<a href="#section-5">5</a> Variant descriptions.......................................<a href="#page-17">17</a>
<a href="#section-5.1">5.1</a> Syntax...................................................<a href="#page-17">17</a>
<a href="#section-5.2">5.2</a> URI......................................................<a href="#page-17">17</a>
<a href="#section-5.3">5.3</a> Source-quality...........................................<a href="#page-18">18</a>
<a href="#section-5.4">5.4</a> Type, charset, language, and length......................<a href="#page-19">19</a>
<a href="#section-5.5">5.5</a> Features.................................................<a href="#page-19">19</a>
<a href="#section-5.6">5.6</a> Description..............................................<a href="#page-19">19</a>
<a href="#section-5.7">5.7</a> Extension-attribute......................................<a href="#page-20">20</a>
<a href="#section-6">6</a> Feature negotiation........................................<a href="#page-20">20</a>
<a href="#section-6.1">6.1</a> Feature tags.............................................<a href="#page-20">20</a>
<a href="#section-6.1.1">6.1.1</a> Feature tag values.....................................<a href="#page-21">21</a>
<a href="#section-6.2">6.2</a> Feature sets.............................................<a href="#page-21">21</a>
<a href="#section-6.3">6.3</a> Feature predicates.......................................<a href="#page-22">22</a>
<a href="#section-6.4">6.4</a> Features attribute.......................................<a href="#page-24">24</a>
<a href="#section-7">7</a> Remote variant selection algorithms........................<a href="#page-25">25</a>
<a href="#section-7.1">7.1</a> Version numbers..........................................<a href="#page-25">25</a>
<a href="#section-8">8</a> Content negotiation status codes and headers...............<a href="#page-25">25</a>
<a href="#section-8.1">8.1</a> 506 Variant Also Negotiates..............................<a href="#page-25">25</a>
<a href="#section-8.2">8.2</a> Accept-Features..........................................<a href="#page-26">26</a>
<a href="#section-8.3">8.3</a> Alternates...............................................<a href="#page-27">27</a>
<a href="#section-8.4">8.4</a> Negotiate................................................<a href="#page-28">28</a>
<a href="#section-8.5">8.5</a> TCN......................................................<a href="#page-30">30</a>
<a href="#section-8.6">8.6</a> Variant-Vary.............................................<a href="#page-30">30</a>
<a href="#section-9">9</a> Cache validators...........................................<a href="#page-31">31</a>
<a href="#section-9.1">9.1</a> Variant list validators..................................<a href="#page-31">31</a>
<a href="#section-9.2">9.2</a> Structured entity tags...................................<a href="#page-31">31</a>
<a href="#section-9.3">9.3</a> Assigning entity tags to variants........................<a href="#page-32">32</a>
<a href="#section-10">10</a> Content negotiation responses..............................<a href="#page-32">32</a>
<a href="#section-10.1">10.1</a> List response...........................................<a href="#page-33">33</a>
<a href="#section-10.2">10.2</a> Choice response.........................................<a href="#page-34">34</a>
<a href="#section-10.3">10.3</a> Adhoc response..........................................<a href="#page-37">37</a>
<a href="#section-10.4">10.4</a> Reusing the Alternates header...........................<a href="#page-38">38</a>
<a href="#section-10.5">10.5</a> Extracting a normal response from a choice response.....<a href="#page-39">39</a>
<a href="#section-10.6">10.6</a> Elaborate Vary headers..................................<a href="#page-39">39</a>
<a href="#section-10.6.1">10.6.1</a> Construction of an elaborate Vary header..............<a href="#page-40">40</a>
<a href="#section-10.6.2">10.6.2</a> Caching of an elaborate Vary header...................<a href="#page-41">41</a>
<a href="#section-10.7">10.7</a> Adding an Expires header for HTTP/1.0 compatibility.....<a href="#page-41">41</a>
<a href="#section-10.8">10.8</a> Negotiation on content encoding.........................<a href="#page-41">41</a>
<span class="grey">Holtman & Mutz Experimental [Page 2]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-3" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
<a href="#section-11">11</a> User agent support for transparent negotiation.............<a href="#page-42">42</a>
<a href="#section-11.1">11.1</a> Handling of responses...................................<a href="#page-42">42</a>
<a href="#section-11.2">11.2</a> Presentation of a transparently negotiated resource.....<a href="#page-42">42</a>
<a href="#section-12">12</a> Origin server support for transparent negotiation..........<a href="#page-43">43</a>
<a href="#section-12.1">12.1</a> Requirements............................................<a href="#page-43">43</a>
<a href="#section-12.2">12.2</a> Negotiation on transactions other than GET and HEAD.....<a href="#page-45">45</a>
<a href="#section-13">13</a> Proxy support for transparent negotiation..................<a href="#page-45">45</a>
<a href="#section-14">14</a> Security and privacy considerations........................<a href="#page-46">46</a>
<a href="#section-14.1">14.1</a> Accept- headers revealing personal information..........<a href="#page-46">46</a>
<a href="#section-14.2">14.2</a> Spoofing of responses from variant resources............<a href="#page-47">47</a>
<a href="#section-14.3">14.3</a> Security holes revealed by negotiation..................<a href="#page-47">47</a>
<a href="#section-15">15</a> Internationalization considerations........................<a href="#page-47">47</a>
<a href="#section-16">16</a> Acknowledgments............................................<a href="#page-47">47</a>
<a href="#section-17">17</a> References.................................................<a href="#page-48">48</a>
<a href="#section-18">18</a> Authors' Addresses.........................................<a href="#page-48">48</a>
<a href="#section-19">19</a> Appendix: Example of a local variant selection algorithm...<a href="#page-49">49</a>
<a href="#section-19.1">19.1</a> Computing overall quality values........................<a href="#page-49">49</a>
<a href="#section-19.2">19.2</a> Determining the result..................................<a href="#page-51">51</a>
<a href="#section-19.3">19.3</a> Ranking dimensions......................................<a href="#page-51">51</a>
<a href="#section-20">20</a> Appendix: feature negotiation examples.....................<a href="#page-52">52</a>
<a href="#section-20.1">20.1</a> Use of feature tags.....................................<a href="#page-52">52</a>
<a href="#section-20.2">20.2</a> Use of numeric feature tags.............................<a href="#page-53">53</a>
<a href="#section-20.3">20.3</a> Feature tag design......................................<a href="#page-53">53</a>
<a href="#section-21">21</a> Appendix: origin server implementation considerations......<a href="#page-54">54</a>
<a href="#section-21.1">21.1</a> Implementation with a CGI script........................<a href="#page-54">54</a>
<a href="#section-21.2">21.2</a> Direct support by HTTP servers..........................<a href="#page-55">55</a>
<a href="#section-21.3">21.3</a> Web publishing tools....................................<a href="#page-55">55</a>
<a href="#section-22">22</a> Appendix: Example of choice response construction..........<a href="#page-55">55</a>
<a href="#section-23">23</a> Full Copyright Statement...................................<a href="#page-58">58</a>
<span class="grey">Holtman & Mutz Experimental [Page 3]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-4" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
<span class="h2"><a class="selflink" id="section-1" href="#section-1">1</a> Introduction</span>
HTTP allows web site authors to put multiple versions of the same
information under a single URI. Each of these versions is called a
`variant'. Transparent content negotiation is an extensible
negotiation mechanism for automatically and efficiently retrieving
the best variant when a GET or HEAD request is made. This enables
the smooth deployment of new web data formats and markup tags.
This specification defines transparent content negotiation as an
extension on top of the HTTP/1.1 protocol [<a href="#ref-1" title=""Hypertext Transfer Protocol -- HTTP/1.1"">1</a>]. However, use of this
extension does not require use of HTTP/1.1: transparent content
negotiation can also be done if some or all of the parties are
HTTP/1.0 [<a href="#ref-2" title=""Hypertext Transfer Protocol -- HTTP/1.0"">2</a>] systems.
Transparent content negotiation is called `transparent' because it
makes all variants which exist inside the origin server visible to
outside parties.
Note: Some members of the IETF are currently undertaking a number
of activities which are loosely related to this experimental
protocol. First, there is an effort to define a protocol-
independent registry for feature tags. The intention is that this
experimental protocol will be one of the clients of the registry.
Second, some research is being done on content negotiation systems
for other transport protocols (like internet mail and internet fax)
and on generalized negotiation systems for multiple transport
protocols. At the time of writing, it is unclear if or when this
research will lead to results in the form of complete negotiation
system specifications. It is also unclear to which extent possible
future specifications can or will re-use elements of this
experimental protocol.
<span class="h3"><a class="selflink" id="section-1.1" href="#section-1.1">1.1</a> Background</span>
The addition of content negotiation to the web infrastructure has
been considered important since the early days of the web. Among the
expected benefits of a sufficiently powerful system for content
negotiation are
* smooth deployment of new data formats and markup tags will
allow graceful evolution of the web
* eliminating the need to choose between a `state of the art
multimedia homepage' and one which can be viewed by all web users
* enabling good service to a wider range of browsing
platforms (from low-end PDA's to high-end VR setups)
<span class="grey">Holtman & Mutz Experimental [Page 4]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-5" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
* eliminating error-prone and cache-unfriendly
User-Agent based negotiation
* enabling construction of sites without `click here for the X
version' links
* internationalization, and the ability to offer multi-lingual
content without a bias towards one language.
<span class="h2"><a class="selflink" id="section-2" href="#section-2">2</a> Terminology</span>
The words "MUST", "MUST NOT", "SHOULD", "SHOULD NOT", and "MAY" in
this document are to be interpreted as described in <a href="./rfc2119">RFC 2119</a> [<a href="#ref-4" title=""Key words for use in RFCs to Indicate Requirement Levels"">4</a>].
This specification uses the term `header' as an abbreviation for for
`header field in a request or response message'.
<span class="h3"><a class="selflink" id="section-2.1" href="#section-2.1">2.1</a> Terms from HTTP/1.1</span>
This specification mostly uses the terminology of the HTTP/1.1
specification [<a href="#ref-1" title=""Hypertext Transfer Protocol -- HTTP/1.1"">1</a>]. For the convenience of the reader, this section
reproduces some key terminology definition from [<a href="#ref-1" title=""Hypertext Transfer Protocol -- HTTP/1.1"">1</a>].
request
An HTTP request message.
response
An HTTP response message.
resource
A network data object or service that can be identified by a URI.
Resources may be available in multiple representations (e.g.
multiple languages, data formats, size, resolutions) or vary in
other ways.
content negotiation
The mechanism for selecting the appropriate representation when
servicing a request.
client
A program that establishes connections for the purpose of sending
requests.
user agent
The client which initiates a request. These are often browsers,
editors, spiders (web-traversing robots), or other end user tools.
<span class="grey">Holtman & Mutz Experimental [Page 5]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-6" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
server
An application program that accepts connections in order to service
requests by sending back responses. Any given program may be
capable of being both a client and a server; our use of these terms
refers only to the role being performed by the program for a
particular connection, rather than to the program's capabilities in
general. Likewise, any server may act as an origin server, proxy,
gateway, or tunnel, switching behavior based on the nature of each
request.
origin server
The server on which a given resource resides or is to be created.
proxy
An intermediary program which acts as both a server and a client
for the purpose of making requests on behalf of other clients.
Requests are serviced internally or by passing them on, with
possible translation, to other servers. A proxy must implement
both the client and server requirements of this specification.
age
The age of a response is the time since it was sent by, or
successfully validated with, the origin server.
fresh
A response is fresh if its age has not yet exceeded its freshness
lifetime.
<span class="h3"><a class="selflink" id="section-2.2" href="#section-2.2">2.2</a> New terms</span>
transparently negotiable resource
A resource, identified by a single URI, which has multiple
representations (variants) associated with it. When servicing a
request on its URI, it allows selection of the best representation
using the transparent content negotiation mechanism. A
transparently negotiable resource always has a variant list bound
to it, which can be represented as an Alternates header (defined in
<a href="#section-8.3">section 8.3</a>).
variant list
A list containing variant descriptions, which can be bound to a
transparently negotiable resource.
<span class="grey">Holtman & Mutz Experimental [Page 6]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-7" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
variant description
A machine-readable description of a variant resource, usually found
in a variant list. A variant description contains the variant
resource URI and various attributes which describe properties of
the variant. Variant descriptions are defined in <a href="#section-5">section 5</a>.
variant resource
A resource from which a variant of a negotiable resource can be
retrieved with a normal HTTP/1.x GET request, i.e. a GET request
which does not use transparent content negotiation.
neighboring variant
A variant resource is called a neighboring variant resource of some
transparently negotiable HTTP resource if the variant resource has
a HTTP URL, and if the absolute URL of the variant resource up to
its last slash equals the absolute URL of the negotiable resource
up to its last slash, where equality is determined with the URI
comparison rules in section 3.2.3 of [<a href="#ref-1" title=""Hypertext Transfer Protocol -- HTTP/1.1"">1</a>]. The property of being a
neighboring variant is important because of security considerations
(<a href="#section-14.2">section 14.2</a>). Not all variants of a negotiable resource need to
be neighboring variants. However, access to neighboring variants
can be more highly optimized by the use of remote variant selection
algorithms (<a href="#section-7">section 7</a>) and choice responses (<a href="#section-10.2">section 10.2</a>).
remote variant selection algorithm
A standardized algorithm by which a server can sometimes choose a
best variant on behalf of a negotiating user agent. The algorithm
typically computes whether the Accept- headers in the request
contain sufficient information to allow a choice, and if so, which
variant is the best variant. The use of a remote algorithm can
speed up the negotiation process.
list response
A list response returns the variant list of the negotiable
resource, but no variant data. It can be generated when the server
does not want to, or is not allowed to, return a particular best
variant for the request. List responses are defined in <a href="#section-10.1">section</a>
<a href="#section-10.1">10.1</a>.
choice response
A choice response returns a representation of the best variant for
the request, and may also return the variant list of the negotiable
resource. It can be generated when the server has sufficient
information to be able to choose the best variant on behalf the
user agent, but may only be generated if this best variant is a
neighboring variant. Choice responses are defined in <a href="#section-10.2">section 10.2</a>.
<span class="grey">Holtman & Mutz Experimental [Page 7]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-8" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
adhoc response
An adhoc response can be sent by an origin server as an extreme
measure, to achieve compatibility with a non-negotiating or buggy
client if this compatibility cannot be achieved by sending a list
or choice response. There are very little requirements on the
contents of an adhoc response. Adhoc responses are defined in
<a href="#section-10.3">section 10.3</a>.
Accept- headers
The request headers: Accept, Accept-Charset, Accept-Language, and
Accept-Features.
supports transparent content negotiation
From the viewpoint of an origin server or proxy, a user agent
supports transparent content negotiation if and only if it sends a
Negotiate header (<a href="#section-8.4">section 8.4</a>) which indicates such support.
server-side override
If a request on a transparently negotiated resource is made by a
client which supports transparent content negotiation, an origin
server is said to perform a server-side override if the server
ignores the directives in the Negotiate request header, and instead
uses a custom algorithm to choose an appropriate response. A
server-side override can sometimes be used to work around known
client bugs. It could also be used by protocol extensions on top
of transparent content negotiation.
<span class="h2"><a class="selflink" id="section-3" href="#section-3">3</a> Notation</span>
The version of BNF used in this document is taken from [<a href="#ref-1" title=""Hypertext Transfer Protocol -- HTTP/1.1"">1</a>], and many
of the nonterminals used are defined in [<a href="#ref-1" title=""Hypertext Transfer Protocol -- HTTP/1.1"">1</a>]. Note that the
underlying charset is US-ASCII.
One new BNF construct is added:
1%rule
stands for one or more instances of "rule", separated by whitespace:
1%rule = rule *( 1*LWS rule )
This specification also introduces
number = 1*DIGIT
short-float = 1*3DIGIT [ "." 0*3DIGIT ]
<span class="grey">Holtman & Mutz Experimental [Page 8]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-9" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
This specification uses the same conventions as in [<a href="#ref-1" title=""Hypertext Transfer Protocol -- HTTP/1.1"">1</a>] (see <a href="#section-1.2">section</a>
<a href="#section-1.2">1.2</a> of [<a href="#ref-1" title=""Hypertext Transfer Protocol -- HTTP/1.1"">1</a>]) for defining the significance of each particular
requirement.
<span class="h2"><a class="selflink" id="section-4" href="#section-4">4</a> Overview</span>
This section gives an overview of transparent content negotiation.
It starts with a more general discussion of negotiation as provided
by HTTP.
<span class="h3"><a class="selflink" id="section-4.1" href="#section-4.1">4.1</a> Content negotiation</span>
HTTP/1.1 allows web site authors to put multiple versions of the same
information under a single resource URI. Each of these versions is
called a `variant'. For example, a resource <a href="http://x.org/paper">http://x.org/paper</a> could
bind to three different variants of a paper:
1. HTML, English
2. HTML, French
3. Postscript, English
Content negotiation is the process by which the best variant is
selected if the resource is accessed. The selection is done by
matching the properties of the available variants to the capabilities
of the user agent and the preferences of the user.
It has always been possible under HTTP to have multiple
representations available for one resource, and to return the most
appropriate representation for each subsequent request. However,
HTTP/1.1 is the first version of HTTP which has provisions for doing
this in a cache-friendly way. These provisions include the Vary
response header, entity tags, and the If-None-Match request header.
<span class="h3"><a class="selflink" id="section-4.2" href="#section-4.2">4.2</a> HTTP/1.0 style negotiation scheme</span>
The HTTP/1.0 protocol elements allow for a negotiation scheme as
follows:
Server _____ proxy _____ proxy _____ user
x.org cache cache agent
< ----------------------------------
| GET <a href="http://x.org/paper">http://x.org/paper</a>
| Accept- headers
choose
|
---------------------------------- >
Best variant
<span class="grey">Holtman & Mutz Experimental [Page 9]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-10" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
When the resource is accessed, the user agent sends (along with its
request) various Accept- headers which express the user agent
capabilities and the user preferences. Then the origin server uses
these Accept- headers to choose the best variant, which is returned
in the response.
The biggest problem with this scheme is that it does not scale well.
For all but the most minimal user agents, Accept- headers expressing
all capabilities and preferences would be very large, and sending
them in every request would be hugely inefficient, in particular
because only a small fraction of the resources on the web have
multiple variants.
<span class="h3"><a class="selflink" id="section-4.3" href="#section-4.3">4.3</a> Transparent content negotiation scheme</span>
The transparent content negotiation scheme eliminates the need to
send huge Accept- headers, and nevertheless allows for a selection
process that always yields either the best variant, or an error
message indicating that user agent is not capable of displaying any
of the available variants.
Under the transparent content negotiation scheme, the server sends a
list with the available variants and their properties to the user
agent. An example of a list with three variants is
{"paper.1" 0.9 {type text/html} {language en}},
{"paper.2" 0.7 {type text/html} {language fr}},
{"paper.3" 1.0 {type application/postscript} {language en}}
The syntax and semantics of the variant descriptions in this list are
covered in <a href="#section-5">section 5</a>. When the list is received, the user agent can
choose the best variant and retrieve it. Graphically, the
communication can be represented as follows:
<span class="grey">Holtman & Mutz Experimental [Page 10]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-11" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
Server _____ proxy _____ proxy _____ user
x.org cache cache agent
< ----------------------------------
| GET <a href="http://x.org/paper">http://x.org/paper</a>
|
----------------------------------- > [list response]
return of list |
choose
|
< ----------------------------------
| GET <a href="http://x.org/paper.1">http://x.org/paper.1</a>
|
---------------------------------- > [normal response]
return of paper.1
The first response returning the list of variants is called a `list
response'. The second response is a normal HTTP response: it does
not contain special content negotiation related information. Only
the user agent needs to know that the second request actually
retrieves a variant. For the other parties in the communication, the
second transaction is indistinguishable from a normal HTTP
transaction.
With this scheme, information about capabilities and preferences is
only used by the user agent itself. Therefore, sending such
information in large Accept- headers is unnecessary. Accept- headers
do have a limited use in transparent content negotiation however; the
sending of small Accept- headers can often speed up the negotiation
process. This is covered in <a href="#section-4.4">section 4.4</a>.
List responses are covered in <a href="#section-10.1">section 10.1</a>. As an example, the list
response in the above picture could be:
HTTP/1.1 300 Multiple Choices
Date: Tue, 11 Jun 1996 20:02:21 GMT
TCN: list
Alternates: {"paper.1" 0.9 {type text/html} {language en}},
{"paper.2" 0.7 {type text/html} {language fr}},
{"paper.3" 1.0 {type application/postscript}
{language en}}
Vary: negotiate, accept, accept-language
ETag: "blah;1234"
Cache-control: max-age=86400
Content-Type: text/html
Content-Length: 227
<h2>Multiple Choices:</h2>
<ul>
<span class="grey">Holtman & Mutz Experimental [Page 11]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-12" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
<li><a href=paper.1>HTML, English version</a>
<li><a href=paper.2>HTML, French version</a>
<li><a href=paper.3>Postscript, English version</a>
</ul>
The Alternates header in the response contains the variant list. The
Vary header is included to ensure correct caching by plain HTTP/1.1
caches (see <a href="#section-10.6">section 10.6</a>). The ETag header allows the response to be
revalidated by caches, the Cache-Control header controls this
revalidation. The HTML entity included in the response allows the
user to select the best variant by hand if desired.
<span class="h3"><a class="selflink" id="section-4.4" href="#section-4.4">4.4</a> Optimizing the negotiation process</span>
The basic transparent negotiation scheme involves two HTTP
transactions: one to retrieve the list, and a second one to retrieve
the chosen variant. There are however several ways to `cut corners'
in the data flow path of the basic scheme.
First, caching proxies can cache both variant lists and variants.
Such caching can reduce the communication overhead, as shown in the
following example:
Server _____ proxy _____ proxy __________ user
x.org cache cache agent
< --------------
| GET ../paper
|
has the list
in cache
|
------------- > [list response]
list |
|
choose
|
< --------------------------
| GET ../paper.1
|
has the variant
in cache
|
-------------------------- > [normal response]
return of paper.1
<span class="grey">Holtman & Mutz Experimental [Page 12]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-13" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
Second, the user agent can send small Accept- headers, which may
contain enough information to allow the server to choose the best
variant and return it directly.
Server _____ proxy _____ proxy _____ user
x.org cache cache agent
< ----------------------------------
| GET <a href="http://x.org/paper">http://x.org/paper</a>
| small Accept- headers
|
able to choose on
behalf of user agent
|
---------------------------------- > [choice response]
return of paper.1 and list
This choosing based on small Accept- headers is done with a `remote
variant selection algorithm'. Such an algorithm takes the variant
list and the Accept- headers as input. It then computes whether the
Accept- headers contain sufficient information to choose on behalf of
the user agent, and if so, which variant is the best variant. If the
best variant is a neighboring variant, it may be returned, together
with the variant list, in a choice response.
A server may only choose on behalf of a user agent supporting
transparent content negotiation if the user agent explicitly allows
the use of a particular remote variant selection algorithm in the
Negotiate request header. User agents with sophisticated internal
variant selection algorithms may want to disallow a remote choice, or
may want to allow it only when retrieving inline images. If the
local algorithm of the user agent is superior in only some difficult
areas of negotiation, it is possible to enable the remote algorithm
for the easy areas only. More information about the use of a remote
variant selection algorithm can be found in [<a href="#ref-3" title=""HTTP Remote Variant Selection Algorithm -- RVSA/1.0"">3</a>].
Choice responses are covered in <a href="#section-10.2">section 10.2</a>. For example, the
choice response in the above picture could be:
HTTP/1.1 200 OK
Date: Tue, 11 Jun 1996 20:05:31 GMT
TCN: choice
Content-Type: text/html
Last-Modified: Mon, 10 Jun 1996 10:01:14 GMT
Content-Length: 5327
Cache-control: max-age=604800
Content-Location: paper.1
Alternates: {"paper.1" 0.9 {type text/html} {language en}},
<span class="grey">Holtman & Mutz Experimental [Page 13]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-14" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
{"paper.2" 0.7 {type text/html} {language fr}},
{"paper.3" 1.0 {type application/postscript}
{language en}}
Etag: "gonkyyyy;1234"
Vary: negotiate, accept, accept-language
Expires: Thu, 01 Jan 1980 00:00:00 GMT
<title>A paper about ....
Finally, the above two kinds of optimization can be combined; a
caching proxy which has the list will sometimes be able to choose on
behalf of the user agent. This could lead to the following
communication pattern:
Server _____ proxy _____ proxy __________ user
x.org cache cache agent
< ---------------
| GET ../paper
| small Accept
|
able to choose
on behalf
|
< ----------
| GET ../paper.1
|
---------- > [normal response]
paper.1 |
---------------- > [choice response]
paper.1 and list
Note that this cutting of corners not only saves bandwidth, it also
eliminates delays due to packet round trip times, and reduces the
load on the origin server.
<span class="h3"><a class="selflink" id="section-4.5" href="#section-4.5">4.5</a> Downwards compatibility with non-negotiating user agents</span>
To handle requests from user agents which do not support transparent
content negotiation, this specification allows the origin server to
revert to a HTTP/1.0 style negotiation scheme. The specification of
heuristics for such schemes is beyond the scope of this document.
<span class="grey">Holtman & Mutz Experimental [Page 14]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-15" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
<span class="h3"><a class="selflink" id="section-4.6" href="#section-4.6">4.6</a> Retrieving a variant by hand</span>
It is always possible for a user agent to retrieve the variant list
which is bound to a negotiable resource. The user agent can use this
list to make available a menu of all variants and their
characteristics to the user. Such a menu allows the user to randomly
browse other variants, and makes it possible to manually correct any
sub-optimal choice made by the automatic negotiation process.
<span class="h3"><a class="selflink" id="section-4.7" href="#section-4.7">4.7</a> Dimensions of negotiation</span>
Transparent content negotiation defines four dimensions of
negotiation:
1. Media type (MIME type)
2. Charset
3. Language
4. Features
The first three dimensions have traditionally been present in HTTP.
The fourth dimension is added by this specification. Additional
dimensions, beyond the four mentioned above, could be added by future
specifications.
Negotiation on the content encoding of a response (gzipped,
compressed, etc.) is left outside of the realm of transparent
negotiation. See <a href="#section-10.8">section 10.8</a> for more information.
<span class="h3"><a class="selflink" id="section-4.8" href="#section-4.8">4.8</a> Feature negotiation</span>
Feature negotiation intends to provide for all areas of negotiation
not covered by the type, charset, and language dimensions. Examples
are negotiation on
* HTML extensions
* Extensions of other media types
* Color capabilities of the user agent
* Screen size
* Output medium (screen, paper, ...)
* Preference for speed vs. preference for graphical detail
The feature negotiation framework (<a href="#section-6">section 6</a>) is the principal means
by which transparent negotiation offers extensibility; a new
dimension of negotiation (really a sub-dimension of the feature
dimension) can be added without the need for a new standards effort
by the simple registration of a `feature tag'.
<span class="grey">Holtman & Mutz Experimental [Page 15]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-16" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
<span class="h3"><a class="selflink" id="section-4.9" href="#section-4.9">4.9</a> Length of variant lists</span>
As a general rule, variant lists should be short: it is expected that
a typical transparently negotiable resource will have 2 to 10
variants, depending on its purpose. Variant lists should be short
for a number of reasons:
1. The user must be able to pick a variant by hand to correct a
bad automatic choice, and this is more difficult with a long
variant list.
2. A large number of variants will decrease the efficiency of
internet proxy caches.
3. Long variant lists will make some transparently negotiated
responses longer.
In general, it is not desirable to create a transparently negotiable
resource with hundreds of variants in order to fine-tune the
graphical presentation of a resource. Any graphical fine-tuning
should be done, as much as possible, by using constructs which act at
the user agent side, for example
<center><img src=titlebanner.gif width=100%
alt="MegaBozo Corp"></center>
In order to promote user agent side fine tuning, which is more
scalable than fine tuning over the network, user agents which
implement a scripting language for content rendering are encouraged
to make the availability of this language visible for transparent
content negotiation, and to allow rendering scripts to access the
capabilities and preferences data used for content negotiation, as
far as privacy considerations permit this.
<span class="h3"><a class="selflink" id="section-4.10" href="#section-4.10">4.10</a> Relation with other negotiation schemes</span>
The HTTP/1.x protocol suite allows for many different negotiation
mechanisms. Transparent content negotiation specializes in scalable,
interoperable negotiation of content representations at the HTTP
level. It is intended that transparent negotiation can co-exist with
other negotiation schemes, both open and proprietary, which cover
different application domains or work at different points in the
author-to-user chain. Ultimately, it will be up to the resource
author to decide which negotiation mechanism, or combination of
negotiation mechanisms, is most appropriate for the task at hand.
<span class="grey">Holtman & Mutz Experimental [Page 16]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-17" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
<span class="h2"><a class="selflink" id="section-5" href="#section-5">5</a> Variant descriptions</span>
<span class="h3"><a class="selflink" id="section-5.1" href="#section-5.1">5.1</a> Syntax</span>
A variant can be described in a machine-readable way with a variant
description.
variant-description =
"{" <"> URI <"> source-quality *variant-attribute"}"
source-quality = qvalue
variant-attribute = "{" "type" media-type "}"
| "{" "charset" charset "}"
| "{" "language" 1#language-tag "}"
| "{" "length" 1*DIGIT "}"
| "{" "features" feature-list "}"
| "{" "description"
quoted-string [ language-tag ] "}"
| extension-attribute
extension-attribute = "{" extension-name extension-value "}"
extension-name = token
extension-value = *( token | quoted-string | LWS
| extension-specials )
extension-specials =
<any element of tspecials except <"> and "}">
The feature-list syntax is defined in <a href="#section-6.4">section 6.4</a>.
Examples are
{"paper.2" 0.7 {type text/html} {language fr}}
{"paper.5" 0.9 {type text/html} {features tables}}
{"paper.1" 0.001}
The various attributes which can be present in a variant description
are covered in the subsections below. Each attribute may appear only
once in a variant description.
<span class="h3"><a class="selflink" id="section-5.2" href="#section-5.2">5.2</a> URI</span>
The URI attribute gives the URI of the resource from which the
variant can be retrieved with a GET request. It can be absolute or
relative to the Request-URI. The variant resource may vary (on the
<span class="grey">Holtman & Mutz Experimental [Page 17]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-18" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
Cookie request header, for example), but MUST NOT engage in
transparent content negotiation itself.
<span class="h3"><a class="selflink" id="section-5.3" href="#section-5.3">5.3</a> Source-quality</span>
The source-quality attribute gives the quality of the variant, as a
representation of the negotiable resource, when this variant is
rendered with a perfect rendering engine on the best possible output
medium.
If the source-quality is less than 1, it often expresses a quality
degradation caused by a lossy conversion to a particular data format.
For example, a picture originally in JPEG form would have a lower
source quality when translated to the XBM format, and a much lower
source quality when translated to an ASCII-art variant. Note
however, that degradation is a function of the source; an original
piece of ASCII-art may degrade in quality if it is captured in JPEG
form.
The source-quality could also represent a level of quality caused by
skill of language translation, or ability of the used media type to
capture the intended artistic expression.
Servers should use the following table a guide when assigning source
quality values:
1.000 perfect representation
0.900 threshold of noticeable loss of quality
0.800 noticeable, but acceptable quality reduction
0.500 barely acceptable quality
0.300 severely degraded quality
0.000 completely degraded quality
The same table can be used by local variant selection algorithms (see
appendix 19) when assigning degradation factors for different content
rendering mechanisms. Note that most meaningful values in this table
are close to 1. This is due to the fact that quality factors are
generally combined by multiplying them, not by adding them.
When assigning source-quality values, servers should not account for
the size of the variant and its impact on transmission and rendering
delays; the size of the variant should be stated in the length
attribute and any size-dependent calculations should be done by the
variant selection algorithm. Any constant rendering delay for a
particular media type (for example due to the startup time of a
helper application) should be accounted for by the user agent, when
assigning a quality factor to that media type.
<span class="grey">Holtman & Mutz Experimental [Page 18]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-19" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
<span class="h3"><a class="selflink" id="section-5.4" href="#section-5.4">5.4</a> Type, charset, language, and length</span>
The type attribute of a variant description carries the same
information as its Content-Type response header counterpart defined
in [<a href="#ref-1" title=""Hypertext Transfer Protocol -- HTTP/1.1"">1</a>], except for any charset information, which MUST be carried in
the charset attribute. For, example, the header
Content-Type: text/html; charset=ISO-8859-4
has the counterpart attributes
{type text/html} {charset ISO-8859-4}
The language and length attributes carry the same information as
their Content-* response header counterparts in [<a href="#ref-1" title=""Hypertext Transfer Protocol -- HTTP/1.1"">1</a>]. The length
attribute, if present, MUST thus reflect the length of the variant
alone, and not the total size of the variant and any objects inlined
or embedded by the variant.
Though all of these attributes are optional, it is often desirable to
include as many attributes as possible, as this will increase the
quality of the negotiation process.
Note: A server is not required to maintain a one-to-one
correspondence between the attributes in the variant description
and the Content-* headers in the variant response. For example,
if the variant description contains a language attribute, the
response does not necessarily have to contain a Content-Language
header. If a Content-Language header is present, it does not have
to contain an exact copy of the information in the language
attribute.
<span class="h3"><a class="selflink" id="section-5.5" href="#section-5.5">5.5</a> Features</span>
The features attribute specifies how the presence or absence of
particular feature tags in the user agent affects the overall quality
of the variant. This attribute is covered in <a href="#section-6.4">section 6.4</a>.
<span class="h3"><a class="selflink" id="section-5.6" href="#section-5.6">5.6</a> Description</span>
The description attribute gives a textual description of the variant.
It can be included if the URI and normal attributes of a variant are
considered too opaque to allow interpretation by the user. If a user
agent is showing a menu of available variants compiled from a variant
list, and if a variant has a description attribute, the user agent
SHOULD show the description attribute of the variant instead of
showing the normal attributes of the variant. The description field
uses the UTF-8 character encoding scheme [<a href="#ref-5" title=""UTF-8, a transformation format of Unicode and ISO 10646"">5</a>], which is a superset of
<span class="grey">Holtman & Mutz Experimental [Page 19]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-20" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
US-ASCII, with ""%" HEX HEX" encoding. The optional language tag MAY
be used to specify the language used in the description text.
<span class="h3"><a class="selflink" id="section-5.7" href="#section-5.7">5.7</a> Extension-attribute</span>
The extension-attribute allows future specifications to incrementally
define dimensions of negotiation which cannot be created by using the
feature negotiation framework, and eases content negotiation
experiments. In experimental situations, servers MUST ONLY generate
extension-attributes whose names start with "x-". User agents SHOULD
ignore all extension attributes they do not recognize. Proxies MUST
NOT run a remote variant selection algorithm if an unknown extension
attribute is present in the variant list.
<span class="h2"><a class="selflink" id="section-6" href="#section-6">6</a> Feature negotiation</span>
This section defines the feature negotiation mechanism. Feature
negotiation has been introduced in <a href="#section-4.8">section 4.8</a>. Appendix 19 contains
examples of feature negotiation.
<span class="h3"><a class="selflink" id="section-6.1" href="#section-6.1">6.1</a> Feature tags</span>
A feature tag (ftag) identifies something which can be negotiated on,
for example a property (feature) of a representation, a capability
(feature) of a user agent, or the preference of a user for a
particular type of representation. The use of feature tags need not
be limited to transparent content negotiation, and not every feature
tag needs to be usable in the HTTP transparent content negotiation
framework.
ftag = token | quoted-string
Note: A protocol-independent system for feature tag registration
is currently being developed in the IETF. This specification does
not define any feature tags. In experimental situations, the use
of tags which start with "x." is encouraged.
Feature tags are used in feature sets (<a href="#section-6.2">section 6.2</a>) and in feature
predicates (<a href="#section-6.3">section 6.3</a>). Feature predicates are in turn used in
features attributes (<a href="#section-6.4">section 6.4</a>), which are used in variant
descriptions (<a href="#section-5">section 5</a>). Variant descriptions can be transmitted in
Alternates headers (<a href="#section-8.3">section 8.3</a>).
The US-ASCII charset is used for feature tags. Feature tag
comparison is case-insensitive. A token tag XYZ is equal to a
quoted-string tag "XYZ". Examples are
tables, fonts, blebber, wolx, screenwidth, colordepth
<span class="grey">Holtman & Mutz Experimental [Page 20]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-21" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
An example of the use of feature tags in a variant description is:
{"index.html" 1.0 {type text/html} {features tables frames}}
This specification follows general computing practice in that it
places no restrictions on what may be called a feature. At the
protocol level, this specification does not distinguish between
different uses of feature tags: a tag will be processed in the same
way, no matter whether it identifies a property, capability, or
preference. For some tags, it may be fluid whether the tag
represents a property, preference, or capability. For example, in
content negotiation on web pages, a "textonly" tag would identify a
capability of a text-only user agent, but the user of a graphical
user agent may use this tag to specify that text-only content is
preferred over graphical content.
<span class="h4"><a class="selflink" id="section-6.1.1" href="#section-6.1.1">6.1.1</a> Feature tag values</span>
The definition of a feature tag may state that a feature tag can have
zero, one, or more values associated with it. These values
specialize the meaning of the tag. For example, a feature tag
`paper' could be associated with the values `A4' and `A5'.
tag-value = token | quoted-string
The US-ASCII charset is used for feature tag values. Equality
comparison for tag values MUST be done with a case-sensitive, octet-
by-octet comparison, where any ""%" HEX HEX" encodings MUST be
processed as in [<a href="#ref-1" title=""Hypertext Transfer Protocol -- HTTP/1.1"">1</a>]. A token value XYZ is equal to a quoted-string
value "XYZ".
<span class="h3"><a class="selflink" id="section-6.2" href="#section-6.2">6.2</a> Feature sets</span>
The feature set of a user agent is a data structure which records the
capabilities of the user agent and the preferences of the user.
Feature sets are used by local variant selection algorithms (see
appendix 19 for an example). A user agent can use the Accept-
Features header (<a href="#section-8.2">section 8.2</a>) to make some of the contents of its
feature set known to remote variant selection algorithms.
Structurally, a feature set is a possibly empty set, containing
records of the form
( feature tag , set of feature tag values )
<span class="grey">Holtman & Mutz Experimental [Page 21]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-22" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
If a record with a feature tag is present in the set, this means that
the user agent implements the corresponding capability, or that the
user has expressed the corresponding preference.
Each record in a feature set has a, possibly empty, set of tag
values. For feature tags which cannot have values associated with
it, this set is always empty. For feature tags which can have zero,
one, or more values associated with it, this set contains those
values currently associated with the tag. If the set of a feature
tag T has the value V in it, it is said that `the tag T is present
with the value V'.
This specification does not define a standard notation for feature
sets. An example of a very small feature set, in a mathematical
notation, is
{ ( "frames" , { } ) ,
( "paper" , { "A4" , "A5" } )
}
As feature registration is expected to be an ongoing process, it is
generally not possible for a user agent to know the meaning of all
feature tags it can possibly encounter in a variant description. A
user agent SHOULD treat all features tags unknown to it as absent
from its feature set.
A user agent may change the contents of its feature set depending on
the type of request, and may also update it to reflect changing
conditions, for example a change in the window size. Therefore, when
considering feature negotiation, one usually talks about `the feature
set of the current request'.
<span class="h3"><a class="selflink" id="section-6.3" href="#section-6.3">6.3</a> Feature predicates</span>
Feature predicates are predicates on the contents of feature sets.
They appear in the features attribute of a variant description.
fpred = [ "!" ] ftag
| ftag ( "=" | "!=" ) tag-value
| ftag "=" "[" numeric-range "]"
numeric-range = [ number ] "-" [ number ]
Feature predicates are used in features attributes (<a href="#section-6.4">section 6.4</a>),
which are used in variant descriptions (<a href="#section-5">section 5</a>). Variant
descriptions can be transmitted in Alternates headers (<a href="#section-8.3">section 8.3</a>).
<span class="grey">Holtman & Mutz Experimental [Page 22]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-23" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
Examples of feature predicates are
blebber, !blebber, paper=a4, colordepth=5, blex!=54,
dpi=[300-599], colordepth=[24-]
Using the feature set of the current request, a user agent SHOULD
compute the truth value of the different feature predicates as
follows.
ftag true if the feature is present, false otherwise
!ftag true if the feature is absent, false otherwise
ftag=V true if the feature is present with the value V,
false otherwise,
ftag!=V true if the feature is not present with the value V,
false otherwise,
ftag=[N-M] true if the feature is present with at least one
numeric value, while the highest value with which it
is present in the range N-M, false otherwise. If N
is missing, the lower bound is 0. If M is missing,
the upper bound is infinity.
As an example, with the feature set
{ ( "blex" , { } ),
( "colordepth" , { "5" } ),
( "UA-media" , { "stationary" } ),
( "paper" , { "A4", "A3" } ) ,
( "x-version" , { "104", "200" } )
}
the following predicates are true:
blex, colordepth=[4-], colordepth!=6, colordepth, !screenwidth, UA-
media=stationary, UA-media!=screen, paper=A4, paper =!A0,
colordepth=[ 4 - 6 ], x-version=[100-300], x-version=[200-300]
and the following predicates are false:
!blex, blebber, colordepth=6, colordepth=foo, !colordepth,
screenwidth, screenwidth=640, screenwidth!=640, x-version=99, UA-
media=screen, paper=A0, paper=a4, x-version=[100-199], wuxta
<span class="grey">Holtman & Mutz Experimental [Page 23]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-24" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
<span class="h3"><a class="selflink" id="section-6.4" href="#section-6.4">6.4</a> Features attribute</span>
The features attribute, for which <a href="#section-5.1">section 5.1</a> defines the syntax
"{" "features" feature-list "}"
is used in a variant description to specify how the presence or
absence of particular feature tags in the user agent affects the
overall quality of the variant.
feature-list = 1%feature-list-element
feature-list-element = ( fpred | fpred-bag )
[ ";" [ "+" true-improvement ]
[ "-" false-degradation ]
]
fpred-bag = "[" 1%fpred "]"
true-improvement = short-float
false-degradation = short-float
Features attributes are used in variant descriptions (<a href="#section-5">section 5</a>).
Variant descriptions can be transmitted in Alternates headers
(<a href="#section-8.3">section 8.3</a>).
Examples are:
{features !textonly [blebber !wolx] colordepth=3;+0.7}
{features !blink;-0.5 background;+1.5 [blebber !wolx];+1.4-0.8}
The default value for the true-improvement is 1. The default value
for the false-degradation is 0, or 1 if a true-improvement value is
given.
A user agent SHOULD, and a remote variant selection algorithm MUST
compute the quality degradation factor associated with the features
attribute by multiplying all quality degradation factors of the
elements of the feature-list. Note that the result can be a factor
greater than 1.
A feature list element yields its true-improvement factor if the
corresponding feature predicate is true, or if at least one element
of the corresponding fpred-bag is true. The element yields its
false-degradation factor otherwise.
<span class="grey">Holtman & Mutz Experimental [Page 24]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-25" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
<span class="h2"><a class="selflink" id="section-7" href="#section-7">7</a> Remote variant selection algorithms</span>
A remote variant selection algorithm is a standardized algorithm by
which a server can choose a best variant on behalf of a negotiating
user agent. The use of a remote algorithm can speed up the
negotiation process by eliminating a request-response round trip.
A remote algorithm typically computes whether the Accept- headers in
the request contain sufficient information to allow a choice, and if
so, which variant is the best variant. This specification does not
define any remote algorithms, but does define a mechanism to
negotiate on the use of such algorithms.
<span class="h3"><a class="selflink" id="section-7.1" href="#section-7.1">7.1</a> Version numbers</span>
A version numbering scheme is used to distinguish between different
remote variant selection algorithms.
rvsa-version = major "." minor
major = 1*4DIGIT
minor = 1*4DIGIT
An algorithm with the version number X.Y, with Y>0, MUST be downwards
compatible with all algorithms from X.0 up to X.Y. Downwards
compatibility means that, if supplied with the same information, the
newer algorithm MUST make the same choice, or a better choice, as the
old algorithm. There are no compatibility requirements between
algorithms with different major version numbers.
<span class="h2"><a class="selflink" id="section-8" href="#section-8">8</a> Content negotiation status codes and headers</span>
This specification adds one new HTTP status code, and introduces six
new HTTP headers. It also extends the semantics of an existing
HTTP/1.1 header.
<span class="h3"><a class="selflink" id="section-8.1" href="#section-8.1">8.1</a> 506 Variant Also Negotiates</span>
The 506 status code indicates that the server has an internal
configuration error: the chosen variant resource is configured to
engage in transparent content negotiation itself, and is therefore
not a proper end point in the negotiation process.
<span class="grey">Holtman & Mutz Experimental [Page 25]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-26" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
<span class="h3"><a class="selflink" id="section-8.2" href="#section-8.2">8.2</a> Accept-Features</span>
The Accept-Features request header can be used by a user agent to
give information about the presence or absence of certain features in
the feature set of the current request. Servers can use this
information when running a remote variant selection algorithm.
Note: the name `Accept-Features' for this header was chosen
because of symmetry considerations with other Accept- headers,
even though the Accept-Features header will generally not contain
an exhaustive list of features which are somehow `accepted'. A
more accurate name of this header would have been `Feature-Set-
Info'.
Accept-Features = "Accept-Features" ":"
#( feature-expr *( ";" feature-extension ) )
feature-expr = [ "!" ] ftag
| ftag ( "=" | "!=" ) tag-value
| ftag "=" "{" tag-value "}"
| "*"
feature-extension = token [ "=" ( token | quoted-string ) ]
No feature extensions are defined in this specification. An example
is:
Accept-Features: blex, !blebber, colordepth={5}, !screenwidth,
paper = A4, paper!="A2", x-version=104, *
The different feature expressions have the following meaning:
ftag ftag is present
!ftag ftag is absent
ftag=V ftag is present with the value V
ftag!=V ftag is present, but not with the value V
ftag={V} ftag is present with the value V, and not with any
other values
* the expressions in this header do not fully describe
the feature set: feature tags not mentioned in this
header may also be present, and, except for the case
ftag={V}, tags may be present with more values than
mentioned.
<span class="grey">Holtman & Mutz Experimental [Page 26]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-27" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
Absence of the Accept-Features header in a request is equivalent to
the inclusion of
Accept-Features: *
By using the Accept-Features header, a remote variant selection
algorithm can sometimes determine the truth value of a feature
predicate on behalf of the user agent. For example, with the header
Accept-Features: blex, !blebber, colordepth={5}, !screenwidth,
paper = A4, paper!="A2", x-version=104, *
the algorithm can determine that the following predicates are true:
blex, colordepth=[4-], colordepth!=6, colordepth, !screenwidth,
paper=A4, colordepth=[4-6]
and that the following predicates are false:
!blex, blebber, colordepth=6, colordepth=foo, !colordepth,
screenwidth, screenwidth=640, screenwidth!=640,
but the truth value of the following predicates cannot be
determined:
UA-media=stationary, UA-media!=screen, paper!=a0,
x-version=[100-300], x-version=[200-300], x-version=99,
UA-media=screen, paper=A0, paper=a4, x-version=[100-199], wuxta
<span class="h3"><a class="selflink" id="section-8.3" href="#section-8.3">8.3</a> Alternates</span>
The Alternates response header is used to convey the list of variants
bound to a negotiable resource. This list can also include
directives for any content negotiation process. If a response from a
transparently negotiable resource includes an Alternates header, this
header MUST contain the complete variant list bound to the negotiable
resource. Responses from resources which do not support transparent
content negotiation MAY also use Alternates headers.
Alternates = "Alternates" ":" variant-list
variant-list = 1#( variant-description
| fallback-variant
| list-directive )
fallback-variant = "{" <"> URI <"> "}"
list-directive = ( "proxy-rvsa" "=" <"> 0#rvsa-version <"> )
<span class="grey">Holtman & Mutz Experimental [Page 27]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-28" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
| extension-list-directive
extension-list-directive =
token [ "=" ( token | quoted-string ) ]
An example is
Alternates: {"paper.1" 0.9 {type text/html} {language en}},
{"paper.2" 0.7 {type text/html} {language fr}},
{"paper.3" 1.0 {type application/postscript}
{language en}},
proxy-rvsa="1.0, 2.5"
Any relative URI specified in a variant-description or fallback-
variant field is relative to the request-URI. Only one fallback-
variant field may be present. If the variant selection algorithm of
the user agent finds that all described variants are unacceptable,
then it SHOULD choose the fallback variant, if present, as the best
variant. If the user agent computes the overall quality values of
the described variants, and finds that several variants share the
highest value, then the first variant with this value in the list
SHOULD be chosen as the best variant.
The proxy-rvsa directive restricts the use of remote variant
selection algorithms by proxies. If present, a proxy MUST ONLY use
algorithms which have one of the version numbers listed, or have the
same major version number and a higher minor version number as one of
the versions listed. Any restrictions set by proxy-rvsa come on top
of the restrictions set by the user agent in the Negotiate request
header. The directive proxy-rvsa="" will disable variant selection
by proxies entirely. Clients SHOULD ignore all extension-list-
directives they do not understand.
A variant list may contain multiple differing descriptions of the
same variant. This can be convenient if the variant uses conditional
rendering constructs, or if the variant resource returns multiple
representations using a multipart media type.
<span class="h3"><a class="selflink" id="section-8.4" href="#section-8.4">8.4</a> Negotiate</span>
The Negotiate request header can contain directives for any content
negotiation process initiated by the request.
Negotiate = "Negotiate" ":" 1#negotiate-directive
negotiate-directive = "trans"
| "vlist"
| "guess-small"
<span class="grey">Holtman & Mutz Experimental [Page 28]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-29" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
| rvsa-version
| "*"
| negotiate-extension
negotiate-extension = token [ "=" token ]
Examples are
Negotiate: 1.0, 2.5
Negotiate: *
The negotiate directives have the following meaning
"trans"
The user agent supports transparent content negotiation for
the current request.
"vlist"
The user agent requests that any transparently negotiated
response for the current request includes an Alternates
header with the variant list bound to the negotiable resource.
Implies "trans".
"guess-small"
The user agent allows origin servers to run a custom algorithm
which guesses the best variant for the request, and to return
this variant in a choice response, if the resulting choice
response is smaller than or not much larger than a list
response. The definition of `not much larger' is left to
origin server heuristics. Implies "vlist" and "trans".
rvsa-version
The user agent allows origin servers and proxies to run the
remote variant selection algorithm with the indicated version
number, or with the same major version number and a higher
minor version number. If the algorithm has sufficient
information to choose a best, neighboring variant, the origin
server or proxy MAY return a choice response with this
variant. Implies "trans".
"*"
The user agent allows origin servers and proxies to run any
remote variant selection algorithm. The origin server may
even run algorithms which have not been standardized. If the
algorithm has sufficient information to choose a best,
neighboring variant, the origin server or proxy MAY return a
choice response with this variant. Implies "trans".
<span class="grey">Holtman & Mutz Experimental [Page 29]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-30" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
Servers SHOULD ignore all negotiate-directives they do not
understand. If the Negotiate header allows a choice between multiple
remote variant selection algorithms which are all supported by the
server, the server SHOULD use some internal precedence heuristics to
select the best algorithm.
<span class="h3"><a class="selflink" id="section-8.5" href="#section-8.5">8.5</a> TCN</span>
The TCN response header is used by a server to signal that the
resource is transparently negotiated.
TCN = "TCN" ":" #( response-type
| server-side-override-directive
| tcn-extension )
response-type = "list" | "choice" | "adhoc"
server-side-override-directive = "re-choose" | "keep"
tcn-extension = token [ "=" ( token | quoted-string ) ]
If the resource is not transparently negotiated, a TCN header MUST
NOT be included in any response. If the resource is transparently
negotiated, a TCN header, which includes the response-type value of
the response, MUST be included in every response with a 2xx status
code or any 3xx status code, except 304, in which it MAY be included.
A TCN header MAY also be included, without a response-type value, in
other responses from transparently negotiated resources.
A server-side override directive MUST be included if the origin
server performed a server-side override when choosing the response.
If the directive is "re-choose", the server MUST include an
Alternates header with the variant bound to the negotiable resource
in the response, and user agent SHOULD use its internal variant
selection algorithm to choose, retrieve, and display the best variant
from this list. If the directive is "keep" the user agent SHOULD NOT
renegotiate on the response, but display it directly, or act on it
directly if it is a redirection response.
Clients SHOULD ignore all tcn-extensions they do not understand.
<span class="h3"><a class="selflink" id="section-8.6" href="#section-8.6">8.6</a> Variant-Vary</span>
The Variant-Vary response header can be used in a choice response to
record any vary information which applies to the variant data (the
entity body combined with some of the entity headers) contained in
the response, rather than to the response as a whole.
<span class="grey">Holtman & Mutz Experimental [Page 30]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-31" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
Variant-Vary = "Variant-Vary" ":" ( "*" | 1#field-name )
Use of the Variant-Vary header is discussed in <a href="#section-10.2">section 10.2</a>.
<span class="h2"><a class="selflink" id="section-9" href="#section-9">9</a> Cache validators</span>
To allow for correct and efficient caching and revalidation of
negotiated responses, this specification extends the caching model of
HTTP/1.1 [<a href="#ref-1" title=""Hypertext Transfer Protocol -- HTTP/1.1"">1</a>] in various ways.
This specification does not introduce a `variant-list-max-age'
directive which explicitly bounds the freshness lifetime of a cached
variant list, like the `max-age' Cache-Control directive bounds the
freshness lifetime of a cached response. However, this specification
does ensure that a variant list which is sent at a time T by the
origin server will never be re-used without revalidation by
semantically transparent caches after the time T+M. This M is the
maximum of all freshness lifetimes assigned (using max-age directives
or Expires headers) by the origin server to
a. the responses from the negotiable resource itself, and
b. the responses from its neighboring variant resources
If no freshness lifetimes are assigned by the origin server, M is the
maximum of the freshness lifetimes which were heuristically assigned
by all caches which can re-use the variant list.
<span class="h3"><a class="selflink" id="section-9.1" href="#section-9.1">9.1</a> Variant list validators</span>
A variant list validator is an opaque value which acts as the cache
validator of a variant list bound to a negotiable resource.
variant-list-validator = <quoted-string not containing any ";">
If two responses contain the same variant list validator, a cache can
treat the Alternates headers in these responses as equivalent (though
the headers themselves need not be identical).
<span class="h3"><a class="selflink" id="section-9.2" href="#section-9.2">9.2</a> Structured entity tags</span>
A structured entity tag consists of a normal entity tag of which the
opaque string is extended with a semicolon followed by the text
(without the surrounding quotes) of a variant list validator:
<span class="grey">Holtman & Mutz Experimental [Page 31]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-32" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
normal | variant list | structured
entity tag | validator | entity tag
-------------+----------------+-----------------
"etag" | "vlv" | "etag;vlv"
W/"etag" | "vlv" | W/"etag;vlv"
Note that a structured entity tag is itself also an entity tag. The
structured nature of the tag allows caching proxies capable of
transparent content negotiation to perform some optimizations defined
in <a href="#section-10">section 10</a>. When not performing such optimizations, a structured
tag SHOULD be treated as a single opaque value, according to the
general rules in HTTP/1.1. Examples of structured entity tags are:
"xyzzy;1234" W/"xyzzy;1234" "gonkxxxx;1234" "a;b;c;;1234"
In the last example, the normal entity tag is "a;b;c;" and the
variant list validator is "1234".
If a transparently negotiated response includes an entity tag, it
MUST be a structured entity tag. The variant list validator in the
structured tag MUST act as a validator for the variant list contained
in the Alternates header. The normal entity tag in the structured
tag MUST act as a validator of the entity body in the response and of
all entity headers except Alternates.
<span class="h3"><a class="selflink" id="section-9.3" href="#section-9.3">9.3</a> Assigning entity tags to variants</span>
To allow for correct revalidation of transparently negotiated
responses by clients, origin servers SHOULD generate all normal
entity tags for the neighboring variant resources of the negotiable
resource in such a way that
1. the same tag is never used by two different variants,
unless this tag labels exactly the same entity on all occasions,
2. if one normal tag "X" is a prefix of another normal tag "XY",
then "Y" must never be a semicolon followed by a variant list
validator.
<span class="h2"><a class="selflink" id="section-10" href="#section-10">10</a> Content negotiation responses</span>
If a request on a transparently negotiated resource yields a response
with a 2xx status code or any 3xx status code except 304, this
response MUST always be either a list response, a choice response, or
an adhoc response. These responses MUST always include a TCN header
which specifies their type. Transparently negotiated responses with
other status codes MAY also include a TCN header.
<span class="grey">Holtman & Mutz Experimental [Page 32]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-33" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
The conditions under which the different content negotiation
responses may be sent are defined in <a href="#section-12.1">section 12.1</a> for origin servers
and in <a href="#section-13">section 13</a> for proxies.
After having constructed a list, choice, or adhoc response, a server
MAY process any If-No-Match or If-Range headers in the request
message and shorten the response to a 304 (Not Modified) or 206
(Partial Content) response, following the rules in the HTTP/1.1
specification [<a href="#ref-1" title=""Hypertext Transfer Protocol -- HTTP/1.1"">1</a>]. In this case, the entity tag of the shortened
response will identify it indirectly as a list, choice, or adhoc
response.
<span class="h3"><a class="selflink" id="section-10.1" href="#section-10.1">10.1</a> List response</span>
A list response returns the variant list of the negotiable resource,
but no variant data. It can be generated when the server does not
want to, or is not allowed to, return a particular best variant for
the request. If the user agent supports transparent content
negotiation, the list response will cause it to select a best variant
and retrieve it.
A list response MUST contain (besides the normal headers required by
HTTP) a TCN header which specifies the "list" response-type, the
Alternates header bound to the negotiable resource, a Vary header and
(unless it was a HEAD request) an entity body which allows the user
to manually select the best variant.
An example of a list response is
HTTP/1.1 300 Multiple Choices
Date: Tue, 11 Jun 1996 20:02:21 GMT
TCN: list
Alternates: {"paper.1" 0.9 {type text/html} {language en}},
{"paper.2" 0.7 {type text/html} {language fr}},
{"paper.3" 1.0 {type application/postscript}
{language en}}
Vary: negotiate, accept, accept-language
ETag: "blah;1234"
Cache-control: max-age=86400
Content-Type: text/html
Content-Length: 227
<h2>Multiple Choices:</h2>
<ul>
<li><a href=paper.1>HTML, English version</a>
<li><a href=paper.2>HTML, French version</a>
<li><a href=paper.3>Postscript, English version</a>
</ul>
<span class="grey">Holtman & Mutz Experimental [Page 33]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-34" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
Note: A list response can have any status code, but the 300
(Multiple Choices) code is the most appropriate one for HTTP/1.1
clients. Some existing versions of HTTP/1.0 clients are known to
silently ignore 300 responses, instead of handling them according
to the HTTP/1.0 specification [<a href="#ref-2" title=""Hypertext Transfer Protocol -- HTTP/1.0"">2</a>]. Servers should therefore be
careful in sending 300 responses to non-negotiating HTTP/1.0 user
agents, and in making these responses cacheable. The 200 (OK)
status code can be used instead.
The Vary header in the response SHOULD ensure correct handling by
plain HTTP/1.1 caching proxies. This header can either be
Vary: *
or a more elaborate header; see <a href="#section-10.6.1">section 10.6.1</a>.
Only the origin server may construct list responses. Depending on
the status code, a list response is cacheable unless indicated
otherwise.
According to the HTTP/1.1 specification [<a href="#ref-1" title=""Hypertext Transfer Protocol -- HTTP/1.1"">1</a>], a user agent which does
not support transparent content negotiation will, when receiving a
list response with the 300 status code, display the entity body
included in the response. If the response contains a Location
header, however, the user agent MAY automatically redirect to this
location.
The handling of list responses by clients supporting transparent
content negotiation is described in sections <a href="#section-11.1">11.1</a> and <a href="#section-13">13</a>.
<span class="h3"><a class="selflink" id="section-10.2" href="#section-10.2">10.2</a> Choice response</span>
A choice response returns a representation of the best variant for
the request, and may also return the variant list of the negotiable
resource. It can be generated when the server has sufficient
information to be able to choose the best variant on behalf the user
agent, but may only be generated if this best variant is a
neighboring variant. For request from user agents which do not
support transparent content negotiation, a server may always generate
a choice response, provided that the variant returned is a
neighboring variant. The variant returned in a choice response need
not necessarily be listed in the variant list bound to the negotiable
resource.
<span class="grey">Holtman & Mutz Experimental [Page 34]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-35" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
A choice response merges a normal HTTP response from the chosen
variant, a TCN header which specifies the "choice" response-type, and
a Content-Location header giving the location of the variant.
Depending on the status code, a choice response is cacheable unless
indicated otherwise.
Origin servers and proxy caches MUST construct choice responses with
the following algorithm (or any other algorithm which gives equal end
results for the client).
In this algorithm, `the current Alternates header' refers to the
Alternates header containing the variant list which was used to
choose the best variant, and `the current variant list validator'
refers to the validator of this list. <a href="#section-10.4">Section 10.4</a> specifies how
these two items can be obtained by a proxy cache.
The algorithm consists of four steps.
1. Construct a HTTP request message on the best variant resource
by rewriting the request-URI and Host header (if appropriate) of
the received request message on the negotiable resource.
2. Generate a valid HTTP response message, but not one with the
304 (Not Modified) code, for the request message constructed in
step 1.
In a proxy cache, the response can be obtained from cache
memory, or by passing the constructed HTTP request towards the
origin server. If the request is passed on, the proxy MAY add,
modify, or delete If-None-Match and If-Range headers to optimize
the transaction with the upstream server.
Note: the proxy should be careful not to add entity tags of
non-neighboring variants to If-* (conditional) headers of the
request, as there are no global uniqueness requirements for
these tags.
3. Only in origin servers: check for an origin server
configuration error. If the HTTP response message generated in
step 2 contains a TCN header, then the best variant resource is
not a proper end point in the transparent negotiation process,
and a 506 (Variant Also Negotiates) error response message
SHOULD be generated instead of going to step 4.
4. Add a number of headers to the HTTP response message generated
in step 2.
<span class="grey">Holtman & Mutz Experimental [Page 35]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-36" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
a. Add a TCN header which specifies the "choice"
response-type.
b. Add a Content-Location header giving the location of the
chosen variant. Delete any Content-Location header which was
already present.
Note: According to the HTTP/1.1 specification [<a href="#ref-1" title=""Hypertext Transfer Protocol -- HTTP/1.1"">1</a>], if the
Content-Location header contains a relative URI, this URI
is relative to the URI in the Content-Base header, if
present, and relative to the request-URI if no Content-
Base header is present.
c. If any Vary headers are present in the response message
from step 2, add, for every Vary header, a Variant-Vary
header with a copy of the contents of this Vary header.
d. Delete any Alternates headers which are present in in the
response. Now, the current Alternates header MUST be added
if this is required by the Negotiate request header, or if
the server returns "re-choose" in the TCN response header.
Otherwise, the current Alternates header MAY be added.
Note: It is usually a good strategy to always add the
current Alternates header, unless it is very large
compared to the rest of the response.
e. Add a Vary header to ensure correct handling by plain
HTTP/1.1 caching proxies. This header can either be
Vary: *
or a more elaborate header, see <a href="#section-10.6">section 10.6</a>.
f. To ensure compatibility with HTTP/1.0 caching proxies which
do not recognize the Vary header, an Expires header with a
date in the past MAY be added. See <a href="#section-10.7">section 10.7</a> for more
information.
g. If an ETag header is present in the response message from
step 2, then extend the entity tag in that header with the
current variant list validator, as specified in <a href="#section-9.2">section 9.2</a>.
Note: Step g. is required even if the variant list itself
is not added in step d.
h. Only in proxy caches: set the Age header of the response to
max( variant_age , alternates_age )
<span class="grey">Holtman & Mutz Experimental [Page 36]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-37" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
where variant_age is the age of the variant response obtained
in step 2, calculated according to the rules in the HTTP/1.1
specification [<a href="#ref-1" title=""Hypertext Transfer Protocol -- HTTP/1.1"">1</a>], and alternates_age is the age of the
Alternates header added in step d, calculated according to
the rules in <a href="#section-10.4">section 10.4</a>.
Note that a server can shorten the response produced by the above
algorithm to a 304 (Not Modified) response if an If-None-Match header
in the original request allows it. If this is the case, an
implementation of the above algorithm can avoid the unnecessary
internal construction of full response message in step 2, it need
only construct the parts which end up in the final 304 response. A
proxy cache which implements this optimization can sometimes generate
a legal 304 response even if it has not cached the variant data
itself.
An example of a choice response is:
HTTP/1.1 200 OK
Date: Tue, 11 Jun 1996 20:05:31 GMT
TCN: choice
Content-Type: text/html
Last-Modified: Mon, 10 Jun 1996 10:01:14 GMT
Content-Length: 5327
Cache-control: max-age=604800
Content-Location: paper.1
Alternates: {"paper.1" 0.9 {type text/html} {language en}},
{"paper.2" 0.7 {type text/html} {language fr}},
{"paper.3" 1.0 {type application/postscript}
{language en}}
Etag: "gonkyyyy;1234"
Vary: negotiate, accept, accept-language
Expires: Thu, 01 Jan 1980 00:00:00 GMT
<title>A paper about ....
<span class="h3"><a class="selflink" id="section-10.3" href="#section-10.3">10.3</a> Adhoc response</span>
An adhoc response can be sent by an origin server as an extreme
measure, to achieve compatibility with a non-negotiating or buggy
client if this compatibility cannot be achieved by sending a list or
choice response. There are very little requirements on the contents
of an adhoc response. An adhoc response MUST have a TCN header which
specifies the "adhoc" response-type, and a Vary header if the
response is cacheable. It MAY contain the Alternates header bound to
the negotiable resource.
<span class="grey">Holtman & Mutz Experimental [Page 37]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-38" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
Any Vary header in the response SHOULD ensure correct handling by
plain HTTP/1.1 caching proxies. This header can either be
Vary: *
or a more elaborate header, see <a href="#section-10.6.1">section 10.6.1</a>. Depending on the
status code, an adhoc response is cacheable unless indicated
otherwise.
As an example of the use of an adhoc response, suppose that the
variant resource "redirect-to-blah" yields redirection (302)
responses. A choice response with this variant could look as
follows:
HTTP/1.1 302 Moved Temporarily
Date: Tue, 11 Jun 1996 20:02:28 GMT
TCN: choice
Content-location: redirect-to-blah
Location: <a href="http://blah.org/">http://blah.org/</a>
Content-Type: text/html
Content-Length: 62
This document is available <a href=http://blah.org/>here</a>.
Suppose that the server knows that the receiving user agent has a
bug, which causes it to crash on responses which contain both a
Content-Location and a Location header. The server could then work
around this bug by performing a server-side override and sending the
following adhoc response instead:
HTTP/1.1 302 Moved Temporarily
Date: Tue, 11 Jun 1996 20:02:28 GMT
TCN: adhoc, keep
Location: <a href="http://blah.org/">http://blah.org/</a>
Content-Type: text/html
Content-Length: 62
This document is available <a href=http://blah.org/>here</a>.
<span class="h3"><a class="selflink" id="section-10.4" href="#section-10.4">10.4</a> Reusing the Alternates header</span>
If a proxy cache has available a negotiated response which is
cacheable, fresh, and has ETag and Alternates headers, then it MAY
extract the Alternates header and associated variant list validator
from the response, and reuse them (without unnecessary delay) to
<span class="grey">Holtman & Mutz Experimental [Page 38]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-39" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
negotiate on behalf of the user agent (<a href="#section-13">section 13</a>) or to construct a
choice response (<a href="#section-10.2">section 10.2</a>). The age of the extracted Alternates
header is the age of the response from which it is extracted,
calculated according to the rules in the HTTP/1.1 specification [<a href="#ref-1" title=""Hypertext Transfer Protocol -- HTTP/1.1"">1</a>].
<span class="h3"><a class="selflink" id="section-10.5" href="#section-10.5">10.5</a> Extracting a normal response from a choice response</span>
If a proxy receives a choice response, it MAY extract and cache the
normal HTTP response contained therein. The normal response can be
extracted by taking a copy of the choice response and then deleting
any Content-Location, Alternates, and Vary headers, renaming any
Variant-Vary headers to Vary headers, and shortening the structured
entity tag in any ETag header to a normal entity tag.
This normal response MAY be cached (as a HTTP response to the variant
request as constructed in step 1. of <a href="#section-10.2">section 10.2</a>) and reused to
answer future direct requests on the variant resource, according to
the rules in the HTTP/1.1 specification [<a href="#ref-1" title=""Hypertext Transfer Protocol -- HTTP/1.1"">1</a>].
Note: The caching of extracted responses can decrease the upstream
bandwidth usage with up to a factor 2, because two independent
HTTP/1.1 cache entries, one associated with the negotiable
resource URI and one with the variant URI, are created in the same
transaction. Without this optimization, both HTTP/1.1 cache
entries can only be created by transmitting the variant data
twice.
For security reasons (see <a href="#section-14.2">section 14.2</a>), an extracted normal response
MUST NEVER be cached if belongs to a non-neighboring variant
resource. If the choice response claims to contain data for a non-
neighboring variant resource, the proxy SHOULD reject the choice
response as a probable spoofing attempt.
<span class="h3"><a class="selflink" id="section-10.6" href="#section-10.6">10.6</a> Elaborate Vary headers</span>
If a HTTP/1.1 [<a href="#ref-1" title=""Hypertext Transfer Protocol -- HTTP/1.1"">1</a>] server can generate varying responses for a request
on some resource, then the server MUST include a Vary header in these
responses if they are cacheable. This Vary header is a signal to
HTTP/1.1 caches that something special is going on. It prevents the
caches from returning the currently chosen response for every future
request on the resource.
Servers engaging in transparent content negotiation will generate
varying responses. Therefore, cacheable list, choice, and adhoc
responses MUST always include a Vary header.
<span class="grey">Holtman & Mutz Experimental [Page 39]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-40" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
The most simple Vary header which can be included is
Vary: *
This header leaves the way in which the response is selected by the
server completely unspecified.
A more elaborate Vary header MAY be used to allow for certain
optimizations in HTTP/1.1 caches which do not have specific
optimizations for transparent content negotiation, but which do cache
multiple variant responses for one resource. Such a more elaborate
Vary header lists all request headers which can be used by the server
when selecting a response for a request on the resource.
<span class="h4"><a class="selflink" id="section-10.6.1" href="#section-10.6.1">10.6.1</a> Construction of an elaborate Vary header</span>
Origin servers can construct a more elaborate Vary header in the
following way. First, start with the header
Vary: negotiate
`negotiate' is always included because servers use the information in
the Negotiate header when choosing between a list, choice, or adhoc
response.
Then, if any of the following attributes is present in any variant
description in the Alternates header, add the corresponding header
name to the Vary header
attribute | header name to add
-----------+---------------------
type | accept
charset | accept-charset
language | accept-language
features | accept-features
The Vary header constructed in this way specifies the response
variation which can be caused by the use of a variant selection
algorithm in proxies. If the origin server will in some cases, for
example if contacted by a non-negotiating user agent, use a custom
negotiation algorithm which takes additional headers into account,
these names of these headers SHOULD also be added to the Vary header.
<span class="grey">Holtman & Mutz Experimental [Page 40]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-41" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
<span class="h4"><a class="selflink" id="section-10.6.2" href="#section-10.6.2">10.6.2</a> Caching of an elaborate Vary header</span>
A proxy cache cannot construct an elaborate vary header using the
method above, because this method requires exact knowledge of any
custom algorithms present in the origin server. However, when
extracting an Alternates header from a response (<a href="#section-10.4">section 10.4</a>) caches
MAY also extract the Vary header in the response, and reuse it along
with the Alternates header. A clean Vary header can however only be
extracted if the variant does not vary itself, i.e. if a Variant-Vary
header is absent.
<span class="h3"><a class="selflink" id="section-10.7" href="#section-10.7">10.7</a> Adding an Expires header for HTTP/1.0 compatibility</span>
To ensure compatibility with HTTP/1.0 caching proxies which do not
recognize the Vary header, an Expires header with a date in the past
can be added to the response, for example
Expires: Thu, 01 Jan 1980 00:00:00 GMT
If this is done by an origin server, the server SHOULD usually also
include a Cache-Control header for the benefit of HTTP/1.1 caches,
for example
Cache-Control: max-age=604800
which overrides the freshness lifetime of zero seconds specified by
the included Expires header.
Note: This specification only claims downwards compatibility with
the HTTP/1.0 proxy caches which implement the HTTP/1.0
specification [<a href="#ref-2" title=""Hypertext Transfer Protocol -- HTTP/1.0"">2</a>]. Some legacy proxy caches which return the
HTTP/1.0 protocol version number do not honor the HTTP/1.0 Expires
header as specified in [<a href="#ref-2" title=""Hypertext Transfer Protocol -- HTTP/1.0"">2</a>]. Methods for achieving compatibility
with such proxy caches are beyond the scope of this specification.
<span class="h3"><a class="selflink" id="section-10.8" href="#section-10.8">10.8</a> Negotiation on content encoding</span>
Negotiation on the content encoding of a response is orthogonal to
transparent content negotiation. The rules for when a content
encoding may be applied are the same as in HTTP/1.1: servers MAY
content-encode responses that are the result of transparent content
negotiation whenever an Accept-Encoding header in the request allows
it. When negotiating on the content encoding of a cacheable
response, servers MUST add the accept-encoding header name to the
Vary header of the response, or add `Vary: *'.
<span class="grey">Holtman & Mutz Experimental [Page 41]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-42" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
Servers SHOULD always be able to provide unencoded versions of every
transparently negotiated response. This means in particular that
every variant in the variant list SHOULD at least be available in an
unencoded form.
Like HTTP/1.1, this specification allows proxies to encode or decode
relayed or cached responses on the fly, unless explicitly forbidden
by a Cache-Control directive. The encoded or decoded response still
contains the same variant as far as transparent content negotiation
is concerned. Note that HTTP/1.1 requires proxies to add a Warning
header if the encoding of a response is changed.
<span class="h2"><a class="selflink" id="section-11" href="#section-11">11</a> User agent support for transparent negotiation</span>
This section specifies the requirements a user agent needs to satisfy
in order to support transparent negotiation. If the user agent
contains an internal cache, this cache MUST conform to the rules for
proxy caches in <a href="#section-13">section 13</a>.
<span class="h3"><a class="selflink" id="section-11.1" href="#section-11.1">11.1</a> Handling of responses</span>
If a list response is received when a resource is accessed, the user
agent MUST be able to automatically choose, retrieve, and display the
best variant, or display an error message if none of the variants are
acceptable.
If a choice response is received when a resource is accessed, the
usual action is to automatically display the enclosed entity.
However, if a remote variant selection algorithm which was enabled
could have made a choice different from the choice the local
algorithm would make, the user agent MAY apply its local algorithm to
any variant list in the response, and automatically retrieve and
display another variant if the local algorithm makes an other choice.
When receiving a choice response, a user agent SHOULD check if
variant resource is a neighboring variant resource of the negotiable
resource. If this is not the case, the user agent SHOULD reject the
choice response as a probable spoofing attempt and display an error
message, for example by internally replacing the choice response with
a 502 (bad gateway) response.
<span class="h3"><a class="selflink" id="section-11.2" href="#section-11.2">11.2</a> Presentation of a transparently negotiated resource</span>
If the user agent is displaying a variant which is not an embedded or
inlined object and which is the result of transparent content
negotiation, the following requirements apply.
<span class="grey">Holtman & Mutz Experimental [Page 42]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-43" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
1. The user agent SHOULD allow the user to review a list of all
variants bound to the negotiable resource, and to manually
retrieve another variant if desired. There are two general ways
of providing such a list. First, the information in the
Alternates header of the negotiable resource could be used to
make an annotated menu of variants. Second, the entity included
in a list response of the negotiable resource could be displayed.
Note that a list response can be obtained by doing a GET request
which only has the "trans" directive in the Negotiate header.
2. The user agent SHOULD make available though its user interface
some indication that the resource being displayed is a negotiated
resource instead of a plain resource. It SHOULD also allow the
user to examine the variant list included in the Alternates
header. Such a notification and review mechanism is needed
because of privacy considerations, see <a href="#section-14.1">section 14.1</a>.
3. If the user agent shows the URI of the displayed information to
the user, it SHOULD be the negotiable resource URI, not the
variant URI that is shown. This encourages third parties, who
want to refer to the displayed information in their own
documents, to make a hyperlink to the negotiable resource as a
whole, rather than to the variant resource which happens to be
shown. Such correct linking is vital for the interoperability of
content across sites. The user agent SHOULD however also provide
a means for reviewing the URI of the particular variant which is
currently being displayed.
4. Similarly, if the user agent stores a reference to the
displayed information for future use, for example in a hotlist,
it SHOULD store the negotiable resource URI, not the variant URI.
It is encouraged, but not required, that some of the above
functionality is also made available for inlined or embedded objects,
and when a variant which was selected manually is being displayed.
<span class="h2"><a class="selflink" id="section-12" href="#section-12">12</a> Origin server support for transparent negotiation</span>
<span class="h3"><a class="selflink" id="section-12.1" href="#section-12.1">12.1</a> Requirements</span>
To implement transparent negotiation on a resource, the origin server
MUST be able to send a list response when getting a GET request on
the resource. It SHOULD also be able to send appropriate list
responses for HEAD requests. When getting a request on a
transparently negotiable resource, the origin server MUST NEVER
return a response with a 2xx status code or any 3xx status code,
except 304, which is not a list, choice, or adhoc response.
<span class="grey">Holtman & Mutz Experimental [Page 43]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-44" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
If the request includes a Negotiate header with a "vlist" or "trans"
directive, but without any directive which allows the server to
select a best variant, a list response MUST ALWAYS be sent, except
when the server is performing a server-side override for bug
compatibility. If the request includes a Negotiate header with a
"vlist" or "guess-small" directive, an Alternates header with the
variant list bound to the negotiable resource MUST ALWAYS be sent in
any list, choice, or adhoc response, except when the server is
performing a server-side override for bug compatibility.
If the Negotiate header allows it, the origin server MAY run a remote
variant selection algorithm. If the algorithm has sufficient
information to choose a best variant, and if the best variant is a
neighboring variant, the origin server MAY return a choice response
with this variant.
When getting a request on a transparently negotiable resource from a
user agent which does not support transparent content negotiation,
the origin server MAY use a custom algorithm to select between
sending a list, choice, or adhoc response.
The following table summarizes the rules above.
|Req on |Usr agnt|server- | Response may be: |
|trans neg|capable |side +------+------+------+------+------+
|resource?|of TCN? |override?|list |choice|adhoc |normal|error |
+---------+--------+---------+------+------+------+------+------+
| Yes | Yes | No |always|smt(*)|never |never |always|
+---------+--------+---------+------+------+------+------+------+
| Yes | Yes | Yes |always|always|always|never |always|
+---------+--------+---------+------+------+------+------+------+
| Yes | No | - |always|always|always|never |always|
+---------+--------+---------+------+------+------+------+------+
| No | - | - |never |never |never |always|always|
+---------+--------+---------+------+------+------+------+------+
(*) sometimes, when allowed by the Negotiate request header
Negotiability is a binary property: a resource is either
transparently negotiated, or it is not. Origin servers SHOULD NOT
vary the negotiability of a resource, or the variant list bound to
that resource, based on the request headers which are received. The
variant list and the property of being negotiated MAY however change
through time. The Cache-Control header can be used to control the
propagation of such time-dependent changes through caches.
It is the responsibility of the author of the negotiable resource to
ensure that all resources in the variant list serve the intended
content, and that the variant resources do not engage in transparent
<span class="grey">Holtman & Mutz Experimental [Page 44]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-45" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
content negotiation themselves.
<span class="h3"><a class="selflink" id="section-12.2" href="#section-12.2">12.2</a> Negotiation on transactions other than GET and HEAD</span>
If a resource is transparently negotiable, this only has an impact on
the GET and HEAD transactions on the resource. It is not possible
(under this specification) to do transparent content negotiation on
the direct result of a POST request.
However, a POST request can return an unnegotiated 303 (See Other)
response which causes the user agent to do a GET request on a second
resource. This second resource could then use transparent content
negotiation to return an appropriate final response. The figure
below illustrates this.
Server ______ proxy ______ proxy ______ user
x.org cache cache agent
< -------------------------------------
| POST <a href="http://x.org/cgi/submit">http://x.org/cgi/submit</a>
| <form contents in request body>
|
-------------------------------------- >
303 See Other |
Location: <a href="http://x.org/result/OK">http://x.org/result/OK</a> |
|
< -------------------------------------
| GET <a href="http://x.org/result/OK">http://x.org/result/OK</a>
| small Accept- headers
|
able to choose on
behalf of user agent
|
------------------------------------- >
choice response with |
..result/OK.nl variant |
displays OK.nl
See the HTTP/1.1 specification [<a href="#ref-1" title=""Hypertext Transfer Protocol -- HTTP/1.1"">1</a>] for details on the 303 (See Other)
status code. Note that this status code is not understood by some
HTTP/1.0 clients.
<span class="h2"><a class="selflink" id="section-13" href="#section-13">13</a> Proxy support for transparent negotiation</span>
Transparent content negotiation is an extension on top of HTTP/1.x.
It is designed to work through any proxy which only implements the
HTTP/1.1 specification [<a href="#ref-1" title=""Hypertext Transfer Protocol -- HTTP/1.1"">1</a>]. If Expires headers are added as
discussed in <a href="#section-10.7">section 10.7</a>, negotiation will also work though proxies
<span class="grey">Holtman & Mutz Experimental [Page 45]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-46" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
which implement HTTP/1.0 [<a href="#ref-2" title=""Hypertext Transfer Protocol -- HTTP/1.0"">2</a>]. Thus, every HTTP/1.0 or HTTP/1.1 proxy
provides support for transparent content negotiation. However, if it
is to be claimed that a HTTP/1.x proxy offers transparent content
negotiation services, at least one of the specific optimizations
below MUST be implemented.
An HTTP/1.x proxy MUST ONLY optimize (change) the HTTP traffic
flowing through it in ways which are explicitly allowed by the
specification(s) it conforms to. A proxy which supports transparent
content negotiation on top of HTTP/1.x MAY perform the optimizations
allowed for by HTTP/1.x. In addition, it MAY perform three
additional optimizations, defined below, on the HTTP traffic for
transparently negotiated resources and their neighboring variant
resources.
First, when getting a request on a transparently negotiable resource
from a user agent which supports transparent content negotiation, the
proxy MAY return any cached, fresh list response from that resource,
even if the selecting request headers, as specified by the Vary
header, do not match.
Second, when allowed by the user agent and origin server, a proxy MAY
reuse an Alternates header taken from a previous response (<a href="#section-10.4">section</a>
<a href="#section-10.4">10.4</a>) to run a remote variant selection algorithm. If the algorithm
has sufficient information to choose a best variant, and if the best
variant is a neighboring variant, the proxy MAY return a choice
response with this variant.
Third, if a proxy receives a choice response, it MAY extract and
cache the normal response embedded therein, as described in <a href="#section-10.5">section</a>
<a href="#section-10.5">10.5</a>.
<span class="h2"><a class="selflink" id="section-14" href="#section-14">14</a> Security and privacy considerations</span>
<span class="h3"><a class="selflink" id="section-14.1" href="#section-14.1">14.1</a> Accept- headers revealing personal information</span>
Accept- headers, in particular Accept-Language headers, may reveal
information which the user would rather keep private unless it will
directly improve the quality of service. For example, a user may not
want to send language preferences to sites which do not offer multi-
lingual content. The transparent content negotiation mechanism
allows user agents to omit sending of the Accept-Language header by
default, without adversely affecting the outcome of the negotiation
process if transparently negotiated multi-lingual content is
accessed.
<span class="grey">Holtman & Mutz Experimental [Page 46]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-47" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
However, even if Accept- headers are never sent, the automatic
selection and retrieval of a variant by a user agent will reveal a
preference for this variant to the server. A malicious service
author could provide a page with `fake' negotiability on (ethnicity-
correlated) languages, with all variants actually being the same
English document, as a means of obtaining privacy-sensitive
information. Such a plot would however be visible to an alert victim
if the list of available variants and their properties is reviewed.
Some additional privacy considerations connected to Accept- headers
are discussed in [<a href="#ref-1" title=""Hypertext Transfer Protocol -- HTTP/1.1"">1</a>].
<span class="h3"><a class="selflink" id="section-14.2" href="#section-14.2">14.2</a> Spoofing of responses from variant resources</span>
The caching optimization in <a href="#section-10.5">section 10.5</a> gives the implementer of a
negotiable resource control over the responses cached for all
neighboring variant resources. This is a security problem if a
neighboring variant resource belongs to another author. To provide
security in this case, the HTTP server will have to filter the
Content-Location headers in the choice responses generated by the
negotiable resource implementation.
<span class="h3"><a class="selflink" id="section-14.3" href="#section-14.3">14.3</a> Security holes revealed by negotiation</span>
Malicious servers could use transparent content negotiation as a
means of obtaining information about security holes which may be
present in user agents. This is a risk in particular for negotiation
on the availability of scripting languages and libraries.
<span class="h2"><a class="selflink" id="section-15" href="#section-15">15</a> Internationalization considerations</span>
This protocol defines negotiation facilities which can be used for
the internationalization of web content. For the
internationalization of list response bodies (<a href="#section-10.1">section 10.1</a>), HTTP/1.0
style negotiation (<a href="#section-4.2">section 4.2</a>) can be used.
<span class="h2"><a class="selflink" id="section-16" href="#section-16">16</a> Acknowledgments</span>
Work on HTTP content negotiation has been done since at least 1993.
The authors are unable to trace the origin of many of the ideas
incorporated in this document. Many members of the HTTP working
group have contributed to the negotiation model in this
specification. The authors wish to thank the individuals who have
commented on earlier versions of this document, including Brian
Behlendorf, Daniel DuBois, Martin J. Duerst, Roy T. Fielding, Jim
Gettys, Yaron Goland, Dirk van Gulik, Ted Hardie, Graham Klyne, Scott
Lawrence, Larry Masinter, Jeffrey Mogul, Henrik Frystyk Nielsen,
Frederick G.M. Roeber, Paul Sutton, and Klaus Weide and Mark Wood.
<span class="grey">Holtman & Mutz Experimental [Page 47]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-48" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
<span class="h2"><a class="selflink" id="section-17" href="#section-17">17</a> References</span>
[<a id="ref-1">1</a>] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., and
T. Berners-Lee, "Hypertext Transfer Protocol -- HTTP/1.1", <a href="./rfc2068">RFC</a>
<a href="./rfc2068">2068</a>, January 1997.
[<a id="ref-2">2</a>] Berners-Lee, T., Fielding, R., and H. Frystyk, "Hypertext
Transfer Protocol -- HTTP/1.0", <a href="./rfc1945">RFC 1945</a>, May 1996.
[<a id="ref-3">3</a>] Holtman, K., and A. Mutz, "HTTP Remote Variant Selection
Algorithm -- RVSA/1.0", <a href="./rfc2296">RFC 2296</a>, March 1998.
[<a id="ref-4">4</a>] Bradner, S., "Key words for use in RFCs to Indicate Requirement
Levels", <a href="https://www.rfc-editor.org/bcp/bcp14">BCP 14</a>, <a href="./rfc2119">RFC 2119</a>, March 1997.
[<a id="ref-5">5</a>] Yergeau, F., "UTF-8, a transformation format of Unicode and ISO
10646", <a href="./rfc2044">RFC 2044</a>, October 1996.
<span class="h2"><a class="selflink" id="section-18" href="#section-18">18</a> Authors' Addresses</span>
Koen Holtman
Technische Universiteit Eindhoven
Postbus 513
Kamer HG 6.57
5600 MB Eindhoven (The Netherlands)
EMail: koen@win.tue.nl
Andrew H. Mutz
Hewlett-Packard Company
1501 Page Mill Road 3U-3
Palo Alto CA 94304, USA
Fax +1 415 857 4691
EMail: mutz@hpl.hp.com
<span class="grey">Holtman & Mutz Experimental [Page 48]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-49" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
<span class="h2"><a class="selflink" id="section-19" href="#section-19">19</a> Appendix: Example of a local variant selection algorithm</span>
A negotiating user agent will choose the best variant from a variant
list with a local variant selection algorithm. This appendix
contains an example of such an algorithm.
The inputs of the algorithm are a variant list from an Alternates
header, and an agent-side configuration database, which contains
- the feature set of the current request,
- a collection of quality values assigned to media types,
languages, and charsets for the current request, following the
model of the corresponding HTTP/1.1 [<a href="#ref-1" title=""Hypertext Transfer Protocol -- HTTP/1.1"">1</a>] Accept- headers,
- a table which lists `forbidden' combinations of media types and
charsets, i.e. combinations which cannot be displayed because of
some internal user agent limitation.
The output of the algorithm is either the best variant, or the
conclusion that none of the variants are acceptable.
<span class="h3"><a class="selflink" id="section-19.1" href="#section-19.1">19.1</a> Computing overall quality values</span>
As a first step in the local variant selection algorithm, the overall
qualities associated with all variant descriptions in the list are
computed.
The overall quality Q of a variant description is the value
Q = round5( qs * qt * qc * ql * qf * qa )
where rounds5 is a function which rounds a floating point value to 5
decimal places after the point. It is assumed that the user agent
can run on multiple platforms: the rounding function makes the
algorithm independent of the exact characteristics of the underlying
floating point hardware.
The factors qs, qt, qc, ql, qf, and qa are determined as follows.
qs Is the source quality factor in the variant description.
qt The media type quality factor is 1 if there is no type
attribute in the variant description. Otherwise, it is the
quality value assigned to this type by the configuration
database. If the database does not assign a value, then the
factor is 0.
<span class="grey">Holtman & Mutz Experimental [Page 49]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-50" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
qc The charset quality factor is 1 if there is no charset
attribute in the variant description. Otherwise, it is the
quality value assigned to this charset by the configuration
database. If the database does not assign a value, then the
factor is 0.
ql The language quality factor is 1 if there is no language
attribute in the variant description. Otherwise, it is the
highest quality value the configuration database assigns to any
of the languages listed in the language attribute. If the
database does not assign a value to any of the languages
listed, then the factor is 0.
qf The features quality factor is 1 if there is no features
attribute in the variant description. Otherwise, it is the
quality degradation factor computed for the features attribute
using the feature set of the current request.
qa The quality adjustment factor is 0 if the variant description
lists a media type - charset combination which is `forbidden'
by the table, and 1 otherwise.
As an example, if a variant list contains the variant description
{"paper.2" 0.7 {type text/html} {language fr}}
and if the configuration database contains the quality value
assignments
types: text/html;q=1.0, type application/postscript;q=0.8
languages: en;q=1.0, fr;q=0.5
then the local variant selection algorithm will compute the overall
quality for the variant description as follows:
{"paper.2" 0.7 {type text/html} {language fr}}
| | |
| | |
V V V
round5 ( 0.7 * 1.0 * 0.5 ) = 0.35000
With same configuration database, the variant list
{"paper.1" 0.9 {type text/html} {language en}},
{"paper.2" 0.7 {type text/html} {language fr}},
{"paper.3" 1.0 {type application/postscript} {language en}}
would yield the following computations:
<span class="grey">Holtman & Mutz Experimental [Page 50]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-51" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
round5 ( qs * qt * qc * ql * qf * qa ) = Q
--- --- --- --- --- ---
paper.1: 0.9 * 1.0 * 1.0 * 1.0 * 1.0 * 1.0 = 0.90000
paper.1: 0.7 * 1.0 * 1.0 * 0.5 * 1.0 * 1.0 = 0.35000
paper.3: 1.0 * 0.8 * 1.0 * 1.0 * 1.0 * 1.0 = 0.80000
<span class="h3"><a class="selflink" id="section-19.2" href="#section-19.2">19.2</a> Determining the result</span>
Using all computed overall quality values, the end result of the
local variant selection algorithm is determined as follows.
If all overall quality values are 0, then the best variant is the
fallback variant, if there is one in the list, else the result is the
conclusion that none of the variants are acceptable.
If at least one overall quality value is greater than 0, then the
best variant is the variant which has the description with the
highest overall quality value, or, if there are multiple variant
descriptions which share the highest overall quality value, the
variant of the first variant description in the list which has this
highest overall quality value.
<span class="h3"><a class="selflink" id="section-19.3" href="#section-19.3">19.3</a> Ranking dimensions</span>
Consider the following variant list:
{"paper.greek" 1.0 {language el} {charset ISO-8859-7}},
{"paper.english" 1.0 {language en} {charset ISO-8859-1}}
It could be the case that the user prefers the language "el" over
"en", while the user agent can render "ISO-8859-1" better than "ISO-
8859-7". The result is that in the language dimension, the first
variant is best, while the second variant is best in the charset
dimension. In this situation, it would be preferable to choose the
first variant as the best variant: the user settings in the language
dimension should take precedence over the hard-coded values in the
charset dimension.
To express this ranking between dimensions, the user agent
configuration database should have a higher spread in the quality
values for the language dimension than for the charset dimension.
For example, with
languages: el;q=1.0, en-gb;q=0.7, en;q=0.6, da;q=0, ...
charsets: ISO-8859-1;q=1.0, ISO-8859-7;q=0.95,
ISO-8859-5;q=0.97, unicode-1-1;q=0, ...
<span class="grey">Holtman & Mutz Experimental [Page 51]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-52" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
the first variant will have an overall quality of 0.95000, while the
second variant will have an overall quality 0.70000. This makes the
first variant the best variant.
<span class="h2"><a class="selflink" id="section-20" href="#section-20">20</a> Appendix: feature negotiation examples</span>
This appendix contains examples of the use of feature tags in variant
descriptions. The tag names used here are examples only, they do not
in general reflect the tag naming scheme proposed in [<a href="#ref-4" title=""Key words for use in RFCs to Indicate Requirement Levels"">4</a>].
<span class="h3"><a class="selflink" id="section-20.1" href="#section-20.1">20.1</a> Use of feature tags</span>
Feature tags can be used in variant lists to express the quality
degradation associated with the presence or absence of certain
features. One example is
{"index.html.plain" 0.7 },
{"index.html" 1.0 {features tables frames}}
Here, the "{features tables frames}" part expresses that index.html
uses the features tagged as tables and frames. If these features are
absent, the overall quality of index.html degrades to 0. Another
example is
{"home.graphics" 1.0 {features !textonly}},
{"home.textonly" 0.7 }
where the "{features !textonly}" part expresses that home.graphics
requires the absence of the textonly feature. If the feature is
present, the overall quality of home.graphics degrades to 0.
The absence of a feature need not always degrade the overall quality
to 0. In the example
{"x.html.1" 1.0 {features fonts;-0.7}}
the absence of the fonts feature degrades the quality with a factor
of 0.7. Finally, in the example
{"y.html" 1.0 {features [blebber wolx] }}
The "[blebber wolx]" expresses that y.html requires the presence of
the blebber feature or the wolx feature. This construct can be used
in a number of cases:
1. blebber and wolx actually tag the same feature, but they were
registered by different people, and some user agents say they
support blebber while others say they support wolx.
<span class="grey">Holtman & Mutz Experimental [Page 52]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-53" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
2. blebber and wolx are HTML tags of different vendors which
implement the same functionality, and which are used together in
y.html without interference.
3. blebber and wolx are HTML tags of different vendors which
implement the same functionality, and y.html uses the tags in a
conditional HTML construct.
4. blebber is a complicated HTML tag with only a sketchy
definition, implemented by one user agent vendor, and wolx
indicates implementation of a well-defined subset of the blebber
tag by some other vendor(s). y.html uses only this well-defined
subset.
<span class="h3"><a class="selflink" id="section-20.2" href="#section-20.2">20.2</a> Use of numeric feature tags</span>
As an example of negotiation in a numeric area, the following variant
list describes four variants with title graphics designed for
increasing screen widths:
{"home.pda" 1.0 {features screenwidth=[-199] }},
{"home.narrow" 1.0 {features screenwidth=[200-599] }},
{"home.normal" 1.0 {features screenwidth=[600-999] }},
{"home.wide" 1.0 {features screenwidth=[1000-] }},
{"home.normal"}
The last element of the list specifies a safe default for user agents
which do not implement screen width negotiation. Such user agents
will reject the first four variants as unusable, as they seem to rely
on a feature which they do not understand.
<span class="h3"><a class="selflink" id="section-20.3" href="#section-20.3">20.3</a> Feature tag design</span>
When designing a new feature tag, it is important to take into
account that existing user agents, which do not recognize the new tag
will treat the feature as absent. In general, a new feature tag
needs to be designed in such a way that absence of the tag is the
default case which reflects current practice. If this design
principle is ignored, the resulting feature tag will generally be
unusable.
As an example, one could try to support negotiation between
monochrome and color content by introducing a `color' feature tag,
the presence of which would indicate the capability to display color
graphics. However, if this new tag is used in a variant list, for
example
{"rainbow.gif" 1.0 {features color} }
<span class="grey">Holtman & Mutz Experimental [Page 53]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-54" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
{"rainbow.mono.gif" 0.6 {features !color}}
then existing user agents, which would not recognize the color tag,
would all display the monochrome rainbow. The color tag is therefore
unusable in situations where optimal results for existing user agents
are desired. To provide for negotiation in this area, one must
introduce a `monochrome' feature tag; its presence indicates that the
user agent can only render (or the user prefers to view) monochrome
graphics.
<span class="h2"><a class="selflink" id="section-21" href="#section-21">21</a> Appendix: origin server implementation considerations</span>
<span class="h3"><a class="selflink" id="section-21.1" href="#section-21.1">21.1</a> Implementation with a CGI script</span>
Transparent content negotiation has been designed to allow a broad
range of implementation options at the origin server side. A very
minimal implementation can be done using the CGI interface. The CGI
script below is an example.
#!/bin/sh
cat - <<'blex'
TCN: list
Alternates: {"stats.tables.html" 1.0 {type text/html} {features
tables}}, {"stats.html" 0.8 {type text/html}}, {"stats.ps" 0.95
{type application/postscript}}
Vary: *
Content-Type: text/html
<title>Multiple Choices for Web Statistics</title>
<h2>Multiple Choices for Web Statistics:</h2>
<ul>
<li><a href=stats.tables.html>Version with HTML tables</a>
<p>
<li><a href=stats.html>Version without HTML tables</a>
<p>
<li><a href=stats.ps>Postscript version</a>
</ul>
blex
The Alternates header in the above script must be read as a single
line. The script always generates a list response with the 200 (OK)
code, which ensures compatibility with non-negotiating HTTP/1.0
agents.
<span class="grey">Holtman & Mutz Experimental [Page 54]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-55" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
<span class="h3"><a class="selflink" id="section-21.2" href="#section-21.2">21.2</a> Direct support by HTTP servers</span>
Sophisticated HTTP servers could make a transparent negotiation
module available to content authors. Such a module could incorporate
a remote variant selection algorithm and an implementation of the
algorithm for generating choice responses (<a href="#section-10.2">section 10.2</a>). The
definition of interfaces to such modules is beyond the scope of this
specification.
<span class="h3"><a class="selflink" id="section-21.3" href="#section-21.3">21.3</a> Web publishing tools</span>
Web publishing tools could automatically generate several variants of
a document (for example the original TeX version, a HTML version with
tables, a HTML version without tables, and a Postscript version),
together with an appropriate variant list in the interface format of
a HTTP server transparent negotiation module. This would allow
documents to be published as transparently negotiable resources.
<span class="h2"><a class="selflink" id="section-22" href="#section-22">22</a> Appendix: Example of choice response construction</span>
The following is an example of the construction of a choice response
by a proxy cache which supports HTTP/1.1 and transparent content
negotiation. The use of the HTTP/1.1 conditional request mechanisms
is also shown.
Assume that a user agent has cached a variant list with the validator
"1234" for the negotiable resource <a href="http://x.org/paper">http://x.org/paper</a>. Also assume
that it has cached responses from two neighboring variants, with the
entity tags "gonkyyyy" and W/"a;b". Assume that all three user agent
cache entries are stale: they would need to be revalidated before the
user agent can use them. If <a href="http://x.org/paper">http://x.org/paper</a> accessed in this
situation, the user agent could send the following request to its
proxy cache:
GET /paper HTTP/1.1
Host: x.org
User-Agent: WuxtaWeb/2.4
Negotiate: 1.0
Accept: text/html, application/postscript;q=0.4, */*
Accept-Language: en
If-None-Match: "gonkyyyy;1234", W/"a;b;1234"
Assume that the proxy cache has cached the same three items as the
user agent, but that it has revalidated the variant list 8000 seconds
ago, so that the list is still fresh for the proxy. This means that
the proxy can run a remote variant selection algorithm on the list
and the incoming request.
<span class="grey">Holtman & Mutz Experimental [Page 55]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-56" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
Assume that the remote algorithm is able to choose paper.html.en as
the best variant. The proxy can now construct a choice response,
using the algorithm in <a href="#section-10.2">section 10.2</a>. In steps 1 and 2 of the
algorithm, the proxy can construct the following conditional request
on the best variant, and send it to the origin server:
GET /paper.html.en HTTP/1.1
Host: x.org
User-Agent: WuxtaWeb/2.4
Negotiate: 1.0
Accept: text/html, application/postscript;q=0.4, */*
Accept-Language: en
If-None-Match: "gonkyyyy", W/"a;b"
Via: 1.1 fred
On receipt of the response
HTTP/1.1 304 Not Modified
Date: Tue, 11 Jun 1996 20:05:31 GMT
Etag: "gonkyyyy"
from the origin server, the proxy can use its freshly revalidated
paper.html.en cache entry to expand the response to a non-304
response:
HTTP/1.1 200 OK
Date: Tue, 11 Jun 1996 20:05:31 GMT
Content-Type: text/html
Last-Modified: Mon, 10 Jun 1996 10:01:14 GMT
Content-Length: 5327
Cache-control: max-age=604800
Etag: "gonkyyyy"
Via: 1.1 fred
Age: 0
<title>A paper about ....
Using this 200 response, the proxy can construct a choice response
in step 4 of the algorithm:
HTTP/1.1 200 OK
Date: Tue, 11 Jun 1996 20:05:31 GMT
TCN: choice
Content-Type: text/html
Last-Modified: Mon, 10 Jun 1996 10:01:14 GMT
Content-Length: 5327
Cache-control: max-age=604800
Content-Location: paper.html.en
<span class="grey">Holtman & Mutz Experimental [Page 56]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-57" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
Alternates: {"paper.html.en" 0.9 {type text/html} {language en}},
{"paper.html.fr" 0.7 {type text/html} {language fr}},
{"paper.ps.en" 1.0 {type application/postscript}
{language en}}
Etag: "gonkyyyy;1234"
Vary: negotiate, accept, accept-language
Expires: Thu, 01 Jan 1980 00:00:00 GMT
Via: 1.1 fred
Age: 8000
<title>A paper about ....
The choice response can subsequently be shortened to a 304 response,
because of the If-None-Match header in the original request from the
user agent. Thus, the proxy can finally return
HTTP/1.1 304 Not Modified
Date: Tue, 11 Jun 1996 20:05:31 GMT
Etag: "gonkyyyy;1234"
Content-Location: paper.html.en
Vary: negotiate, accept, accept-language
Expires: Thu, 01 Jan 1980 00:00:00 GMT
Via: 1.1 fred
Age: 8000
to the user agent.
<span class="grey">Holtman & Mutz Experimental [Page 57]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-58" ></span>
<span class="grey"><a href="./rfc2295">RFC 2295</a> Transparent Content Negotiation March 1998</span>
<span class="h2"><a class="selflink" id="section-23" href="#section-23">23</a> Full Copyright Statement</span>
Copyright (C) The Internet Society (1998). All Rights Reserved.
This document and translations of it may be copied and furnished to
others, and derivative works that comment on or otherwise explain it
or assist in its implementation may be prepared, copied, published
and distributed, in whole or in part, without restriction of any
kind, provided that the above copyright notice and this paragraph are
included on all such copies and derivative works. However, this
document itself may not be modified in any way, such as by removing
the copyright notice or references to the Internet Society or other
Internet organizations, except as needed for the purpose of
developing Internet standards in which case the procedures for
copyrights defined in the Internet Standards process must be
followed, or as required to translate it into languages other than
English.
The limited permissions granted above are perpetual and will not be
revoked by the Internet Society or its successors or assigns.
This document and the information contained herein is provided on an
"AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Holtman & Mutz Experimental [Page 58]
</pre>
|