Guidelines for Web Content Transformation Proxies 1u

Editor's Draft 23 September 2009

This version:
Latest version:
Previous versions:
Draft 1t 21 Sept 2009 (diff)
Draft 1s - 22 June 2009 (diff)
Draft 1r - 7 June 2009 (diff)
Draft 1q - 13 March 2009 (diff)
Draft 1p - 7 Nov 2008 (diff)
Draft 1o - 30 July 2008 (diff)
Draft 1n - 24 July 2008 (diff)
Draft 1m - 22 July 2008 (diff)
Draft 1l - 12 July 2008 (diff)
Draft 1k - 6 June 2008 (diff)
Jo Rabin, mTLD Top Level Domain (dotMobi)


This document provides guidance to Content Transformation proxies as to whether and how to transform Web content.

Content Transformation proxies alter requests sent by user agents to servers and responses returned by servers so that the appearance, structure or control flow of Web applications are modified. Content Transformation proxies are mostly used to convert Web sites designed for desktop computers to a form suitable for mobile devices.

Based on current practice and standards, this document specifies mechanisms with which Content Transformation proxies should make their presence known to other parties, present the outcome of alterations performed on HTTP traffic, and react to indications set by clients or servers to constrain these alterations.

The objective is to reduce undesirable effects on Web applications, especially mobile-ready ones, and to limit the diversity in the modes of operation of Content Transformation proxies, while at the same time allowing proxies to alter content that would otherwise not display successfully on mobile devices.

Important considerations regarding the impact on security are highlighted.

Status of this Document

This document is an editors' copy that has no official standing.

This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at

This document reflects group resolutions on comments received on the previous Last Call Working Draft.

Publication as a Group Working Draft of a proposed normative Recommendation does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.

This document has been produced by the Mobile Web Best Practices Working Group as part of the Mobile Web Initiative . Please send comments on this document to the Working Group's public email list, a publicly archived mailing list .

This document was produced under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of patent disclosures made in connection with this document; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) with respect to this specification must disclose the information in accordance with section 6 of the W3C Patent Policy.

Table of Contents

1 Introduction (Non-Normative)
    1.1 Purpose
    1.2 Audience
    1.3 Scope
    1.4 Principles
        1.4.1 IAB Considerations
        1.4.2 Priority of Intention
2 Terminology (Normative)
    2.1 Types of Proxy
    2.2 Types of Transformation
3 Conformance (Normative)
    3.1 Classes of Product
    3.2 Normative and Informative Parts
    3.3 Normative Language for Conformance Requirements
    3.4 Transformation Deployment Conformance
4 Behavior of Components (Normative)
    4.1 Proxy Forwarding of Request
        4.1.1 Applicable HTTP Methods
        4.1.2 no-transform directive in Request
        4.1.3 Treatment of Requesters that are not Web browsers
        4.1.4 Serving Cached Responses
        4.1.5 Alteration of HTTP Header Field Values
   Content Tasting
   Avoiding "Request Unacceptable" Responses
   User Selection of Restructured Experience
   Sequence of Requests
   Original Header Fields
        4.1.6 Additional HTTP Header Fields
   Proxy Treatment of Via Header Field
    4.2 Proxy Forwarding of Response to User Agent
        4.2.1 Applicable Responses
        4.2.2 User Preferences
        4.2.3 Receipt of Cache-Control: no-transform
        4.2.4 Use of Cache-Control: no-transform
        4.2.5 Server Rejection of HTTP Request
        4.2.6 Receipt of Vary HTTP Header Field
        4.2.7 Link to "handheld" Representation
        4.2.8 WML Content
        4.2.9 Proxy Decision to Transform
   Alteration of Response
   Link Rewriting
   HTTPS Link Rewriting
5 Testing (Normative)


A References
B Conformance Statement
C Internet Content Types associated with Mobile Content
D DOCTYPEs Associated with Mobile Content
E URI Patterns Associated with Mobile Web Sites
F Summary of User Preference Handling
G Example Transformation Interactions (Non-Normative)
    G.1 Basic Content Tasting by Proxy
    G.2 Optimization based on Previous Server Interaction
    G.3 Optimization based on Previous Server Interaction, Server has Changed its Operation
    G.4 Server Response Indicating that this Representation is Intended for the Target Device
    G.5 Server Response Indicating that another Representation is Intended for the Target Device
H Informative Guidance for Origin Servers (Non-Normative)
    H.1 Server Response to Proxy
        H.1.1 Use of HTTP 406 Status
        H.1.2 Use of HTTP 403 Status
        H.1.3 Server Origination of Cache-Control: no-transform
        H.1.4 Varying Representations
            H.1.4.1 Use of Vary HTTP Header Field
            H.1.4.2 Indication of Intended Presentation Media Type of Representation
I Applicability to Transforming Solutions which are Out of Scope (Non-Normative)
J Scope for Future Work (Non-Normative)
    J.1 POWDER
    J.2 link HTTP Header Field
    J.3 Sources of Device Information
    J.4 Inter Proxy Communication
    J.5 Amendment to and Refinement of HTTP
K Acknowledgments (Non-Normative)

1 Introduction (Non-Normative)

1.3 Scope

The recommendations in this document refer only to "Web browsing" - i.e. access by user agents that are intended primarily for interaction by users with HTML Web pages (Web browsers) using HTTP. Clients that interact with proxies using mechanisms other than HTTP (and that typically involve the download of a special client) are out of scope, and are considered to be a distributed user agent. Proxies which are operated in the control of or under the direction of the operator of an origin server are similarly considered to be a distributed origin server and hence out of scope.

The W3C Mobile Web Best Practices Working Group (BPWG) is not chartered to create new technology - its role is to advise on best practice for use of existing technology. In satisfying Content Transformation requirements, existing HTTP header fields, directives and behaviors must be respected, and as far as is practical, no extensions to [RFC 2616 HTTP] are to be used.

The recommendations in this document refer to interactions of a proxy and do not refer to any presumed aspects of the internal operation of the proxy. For this reason, the document does not discuss use of "allow" and "disallow" lists (though it does discuss behavior that is induced by the implementation of such lists). In addition it does not discuss details of how transformation is carried out except if this is reflected in interoperability. For this reason, it does not discuss the insertion or insertion of headers and footers or any other specific behaviors (though it does discuss the need for essential user interaction of some form).

2 Terminology (Normative)

2.2 Types of Transformation

Transforming proxies can carry out a wide variety of operations. In this document we categorize these operations as follows:

  1. Alteration of Requests

    Transforming proxies process requests in a number of ways, especially replacement of various request header fields to avoid HTTP 406 Status responses (if a server can not provide content that is compatible with the original HTTP request header fields) and at user request.

  2. Alteration of Responses

    There are three classes of operation on responses:

    1. Restructuring content

      Restructuring content is a process whereby the original layout is altered so that content is added or removed or where the spatial or navigational relationship of parts of content is altered, e.g. linearization (i.e. reordering presentation elements, especially tables, so that they fit on a narrow display and can be traversed without horizontal scrolling) or pagination (i.e. splitting a document too large to be stored in or transmitted to the terminal in one piece, so that it can be nevertheless accessed by browsing through a succession of smaller interlinked documents). It also includes rewriting URIs so that subsequent requests are routed via the proxy handling the response.

    2. Recoding content

      Recoding content is a process whereby the layout of the content remains the same, but details of its encoding may be altered. Examples include re-encoding HTML as XHTML, correcting invalid markup in HTML, conversion of images between formats (but not, for example, reducing animations to static images).

    3. Optimizing content

      Optimizing content includes removing redundant white space, re-compressing images (without loss of fidelity) and compressing for transfer.

3 Conformance (Normative)

3.1 Classes of Product

The Content Transformation Guidelines specification has one class of products:

Transformation Deployment

A Transformation Deployment is the provision of non-transparent components in the path of HTTP requests and responses. Provisions that are applicable to a Transformation Deployment are identified in this document by use of the term "transforming proxy" or "proxy" in the singular or plural.

3.4 Transformation Deployment Conformance

A Transformation Deployment conforms to these guidelines if it follows the statements in 4.1 Proxy Forwarding of Request, 4.2 Proxy Forwarding of Response to User Agent and 5 Testing (Normative).

A Transformation Deployment that wishes to claim conformance must make available a conformance statement B Conformance Statement that specifies the reasons for non-compliance with any clauses containing the key words should and should not, recommended and not recommended.

Conformance statements must be sent to Public archives of this list may be found at

4 Behavior of Components (Normative)

4.1 Proxy Forwarding of Request

4.1.2 no-transform directive in Request

If the request contains a Cache-Control: no-transform directive, proxies must not alter the request other than to comply with transparent HTTP behavior defined in [RFC 2616 HTTP] sections section 14.9.5 and section 13.5.2 and to add header fields as described in 4.1.6 Additional HTTP Header Fields below.


An example of the use of Cache-Control: no-transform is the issuing of asynchronous HTTP requests, perhaps by means of XMLHttpRequest [XHR], which may include such a directive in order to prevent transformation of both the request and the response.

4.1.4 Serving Cached Responses

Aside from the usual caching procedures defined in [RFC 2616 HTTP], in some circumstances, proxies may paginate responses and where this is the case a request may be for a subsequent page of a previously requested resource. In this case proxies may for the sake of consistency of representation serve stale data but when doing so should notify the user that this is the case and must provide a simple means of retrieving a fresh copy.

4.1.5 Alteration of HTTP Header Field Values

Aside from the usual procedures defined in [RFC 2616 HTTP] proxies should not modify the values of header fields other than the User-Agent, Accept, Accept-Charset, Accept-Encoding, and Accept-Language header fields and must not delete header fields. It must be possible for the server to reconstruct the original User Agent originated header fields by copying directly from the corresponding X-Device header field values (see Original Header Fields).

Other than to comply with transparent HTTP operation, proxies should not modify any request header fields unless one of the following applies:

  1. the user would be prohibited from accessing content as a result of the server responding that the request is "unacceptable" (see 4.2.5 Server Rejection of HTTP Request);

  2. the user has specifically requested a restructured desktop experience (see User Selection of Restructured Experience);

  3. the request is part of a sequence of requests to the same Web site and either it is technically infeasible not to adjust the request because of earlier interaction, or because doing so preserves consistency of user experience.

These circumstances are detailed in the following sections.


In this section, the concept of "Web site" is used (rather than "origin server") as some origin servers host many different Web sites. Since the concept of "Web site" is not strictly defined, proxies should use heuristics including comparisons of domain name to assess whether resources form part of the same "Web site".


The URI referred to in the request plays no part in determining whether or not to alter HTTP request header field values. In particular the patterns mentioned in 4.2.9 Proxy Decision to Transform are not material. Avoiding "Request Unacceptable" Responses

A proxy may reissue a request with altered HTTP header field values if a previous request with unaltered values resulted in the origin server rejecting the request as "unacceptable" (see 4.2.5 Server Rejection of HTTP Request). A proxy may apply heuristics of various kinds to assess, in advance of sending unaltered header field values, whether the request is likely to cause a "request unacceptable" response. If it determines that this is likely then it may alter header field values without sending unaltered values in advance, providing that it subsequently assesses the response as described under 4.2.6 Receipt of Vary HTTP Header Field below, and is prepared to reissue the request with unaltered header fields, and alter its subsequent behavior in respect of the Web site so that unaltered header fields are sent.

A proxy must not reissue a POST request with altered header fields when the response to the unaltered POST request has HTTP status code 200 (in other words, it may only send the altered request for a POST/PUT request when the unaltered one resulted in an HTTP 406 response, and not a "request unacceptable" response). Sequence of Requests

When requesting resources that are included resources (e.g. style sheets, images), proxies should make the request for such resources with the same User-Agent header field as the request for the resource from which they are referenced.

For the purpose of consistency of representation, proxies may request linked resources (e.g. those referenced using the a element) that form part of the same Web site as a previously requested resource with the same header fields as the resource from which they are referenced.

When requesting linked resources that do not form part of the same Web site as the resource from which they are linked, proxies should not base their choice of header fields on a consistency of presentation premise. Original Header Fields

When forwarding an HTTP request with altered HTTP header fields, in addition to complying with the rules of normal HTTP operation, proxies must include in the request copies of the unaltered header field values in the form "X-Device-"<original header name>. For example, if the User-Agent header field has been altered, an X-Device-User-Agent header field must be added with the value of the received User-Agent header field.

Specifically the following mapping must be used:

User-AgentX-Device-User-AgentRFC2616 Section 14.43
AcceptX-Device-AcceptRFC2616 Section 14.1
Accept-CharsetX-Device-Accept-CharsetRFC2616 Section 14.2
Accept-EncodingX-Device-Accept-EncodingRFC2616 Section 14.3
Accept-LanguageX-Device-Accept-LanguageRFC2616 Section 14.4


The X-Device- prefix was chosen primarily on the basis that this is a already existing convention. It is noted that the values encoded in such header fields may not ultimately derive from a device, they are merely received fields. The treatment of received X-Device header fields, which may happen where there are multiple transforming proxies, is undefined (see J Scope for Future Work).

4.2 Proxy Forwarding of Response to User Agent

In the following, proxies must check for the presence of equivalent <meta http-equiv> elements in HTML content, if the relevant HTTP header field is not present.

4.2.3 Receipt of Cache-Control: no-transform

If the response includes a Cache-Control: no-transform directive then proxies must not alter it other than to comply with transparent HTTP behavior as described in [RFC 2616 HTTP] Section 13.5.2 and Section 14.9.5 and other than as follows.

If a proxy determines that a resource as currently represented is likely to cause serious misoperation of the user agent then it may advise the user that this is the case and must provide the option for the user to continue with unaltered content (and may provide other options too).

4.2.6 Receipt of Vary HTTP Header Field

A proxy may not be carrying out content tasting as described under Avoiding "Request Unacceptable" Responses if it anticipates receiving a "request unacceptable" response. However, if it makes a request with altered header fields in these circumstances, and receives a response containing a Vary header field referring to one of the altered header fields then it should request the resource again with unaltered header fields. It should also update whatever heuristics it uses so that unaltered header fields are presented first in subsequent requests for this resource.

4.2.8 WML Content

If the content is WML proxies should act in a transparent manner.


This does not affect the operation of proxies that are also WAP Gateways.

4.2.9 Proxy Decision to Transform

In the absence of a Vary or no-transform directive (or a meta HTTP-Equiv element containing Cache-Control: no-transform) proxies should not transform content matching any of the following rules unless the user has specifically requested transformation:

Other factors that a proxy may take into account:

  • The Web site (see note) has previously shown that it is contextually aware, even if the present response does not indicate this;

  • the user agent has features (such as linearization or zoom) that allow it to present the content unaltered;

  • the response contains client side scripts that may misoperate if the resource is restructured;

  • the response is an HTML response and it includes <link> elements specifying alternatives according to presentation media type. Alteration of Response

If a proxy alters the response then:

  1. It must add a Warning 214 Transformation Applied HTTP header field;

  2. The altered content should validate according to an appropriate published formal grammar and if XML must be well-formed;

  3. It should indicate to the user that the content has been transformed for mobile presentation and provide an option to view the original, unmodified content. Link Rewriting

Some proxy deployments have to "rewrite" links in content in order for the User Agent to request the referenced resources through the proxy. In so doing, proxies make unrelated resources appear as though they have the same-origin and hence there is a danger of introducing security vulnerabilities.


This section (on link rewriting) refers also to insertion of links, frame flattening and any other techniques that introduces the "same-origin" issue.


Link rewriting is always used by CT Proxies that are accessed as an origin server initially, e.g. which provide mobile adapted web search and navigation to the web pages returned in the search results, or to which the browser is redirected through the CT Proxy for adaptation of a web page. Link rewriting may be used by CT Proxies acting as normal HTTP proxies (e.g. configured or transparent) for the browser, but may not be required since all browser requests flow through the CT Proxy.

Proxies must not rewrite links when content transformation is prohibited.

Proxies must preserve security between requests for domains that are not same-origin in respect of cookies and scripts.

5 Testing (Normative)

Operators of content transformation proxies should make available an interface through which the functions of the proxy can be exercised. The operations possible through this interface must cover those necessary to settle the outcome of all conformance statements listed in section B.

The interface must be reachable from terminals with browsing capabilities connected to the Web via a conventional Internet access environment at the tester's premises; accessing the interface may necessitate adjusting standard Web browsing configuration parameters -- such as specifying a proxy IP address and port on a desktop browser, or activating a WAP setting on a mobile browser.

Such access must be granted under fair, reasonable and non-discriminatory conditions. In particular:

A References

CT Landscape
Content Transformation Landscape 1.0, Jo Rabin, Andrew Swainston (eds), W3C Working Draft 25 October 2007 (See
RFC 2119
Key words for use in RFCs to Indicate Requirement Levels, , Request for Comments: 2119, S. Bradner, March 1997 (See
Hypertext Transfer Protocol -- HTTP/1.1 Request for Comments: 2616, R. Fielding, J. Gettys, J. Mogul, H. Frystyk, L. Masinter, P. Leach, T. Berners-Lee, June 1999 (See
RFC 3986
Uniform Resource Identifier (URI): Generic Syntax, Request for Comments: 3986, T. Berners-Lee, R. Fielding, L. Masinter, January 2005 (See
IAB Architectural and Policy Considerations for Open Pluggable Edge Services, Request for Comments: 3238, S. Floyd, L. Daigle, January 2002 (See
Device Independence Glossary
W3C Glossary of Terms for Device Independence, Rhys Lewis (ed), W3C Working Draft 18 January 2005
Best Practices
Mobile Web Best Practices 1.0 Basic Guidelines, Jo Rabin, Charles McCathieNevile (eds), W3C Recommendation, 29 July 2008 (See
mobileOK Basic Tests
W3C mobileOK Basic Tests 1.0, Sean Owen, Jo Rabin (eds), W3C Recommendation, 08 December 2008 (See
mobileOK Scheme
W3C mobileOK Scheme 1.0, Jo Rabin, Phil Archer (eds), W3C Note, 25 August 2009 (See
The XMLHttpRequest Object, Anne van Kesteren (ed), W3C Working Draft, 15 April 2008 (See
Extensible Markup Language (XML) 1.0 (Fifth Edition), T. Bray, J. Paoli, C. Sperberg-McQueen, E. Maler, F. Yergeau (eds), W3C Recommendation, 26 November 2008. (See

B Conformance Statement

Editorial Note: Update to final location


C Internet Content Types associated with Mobile Content

D DOCTYPEs Associated with Mobile Content

E URI Patterns Associated with Mobile Web Sites

F Summary of User Preference Handling

User expression of preferences is referred to in several sections in this document. Those sections are:

  1. 1.4.2 Priority of Intention

  2. 4.1.4 Serving Cached Responses

  3. User Selection of Restructured Experience

  4. 4.2.2 User Preferences

  5. 4.2.3 Receipt of Cache-Control: no-transform

  6. 4.2.9 Proxy Decision to Transform

  7. Alteration of Response

  8. HTTPS Link Rewriting

User preferences are also referred to non-normatively under H.1.4 Varying Representations.

G Example Transformation Interactions (Non-Normative)

G.3 Optimization based on Previous Server Interaction, Server has Changed its Operation

Proxy receives a request for resource P, that it has previously encountered as in G.2 Optimization based on Previous Server Interaction

Proxy forwards request with altered header fields

Response is 200 OK containing a Vary: User-Agent header field

Proxy notices that behavior has changed and reissues the request with original header fields

Response is 200 OK and proxy forwards it

H Informative Guidance for Origin Servers (Non-Normative)

Content providers may wish to follow these procedures in order to improve interoperability.

H.1 Server Response to Proxy

H.1.4 Varying Representations

It is good practice to take account of user agent capabilities and formulate an appropriate experience according to those capabilities. It is good practice to provide a means for users to select among available representations, to default to the last selected representation and to provide a means of changing the selection.

H.1.4.1 Use of Vary HTTP Header Field

If a server varies its representation according to examination of received HTTP header fields then [RFC 2616 HTTP] describes how to use the Vary header field to indicate this.

Servers that are aware of the presence of a transforming proxy, as identified by a Via HTTP Header field might alter their responses according to their knowledge of specific proxy behavior. When doing so it is good practice to make sure that the Internet content type for a response is correct for the actual content (e.g. a server should not choose Content-Type: application/vnd.wap.xhtml+xml because it suspects that proxies will not transform content of this type, if its content is not valid XHTML-MP).

H.1.4.2 Indication of Intended Presentation Media Type of Representation

If a server has distinct representations that vary according to the target presentation media type, it can inhibit transformation of the response by including a Cache-Control: no-transform directive (see H.1.3 Server Origination of Cache-Control: no-transform).

In addition, in HTML content it can indicate the medium for which the representation is intended by including a link element identifying in its media attribute the target presentation media types of this representation and setting the href attribute to "Same-Document Reference" (see [RFC 3986] section 4.4) and in particular an empty href attribute is a "Same Document Reference".

In addition it is good practice to include link elements identifying the target presentation media types of other available representations in a similar manner.

If content for more than one presentation media type is served from the same URI, it is better not to use a link element identifying the presentation media types as the URI will appear to be a "same document reference", indicating to a client that this representation is suitable for all the named presentation media types. Instead, use a Vary HTTP header field indicating that the response varies according to the received User-Agent HTTP header field.


Some examples of the use of the link element are included above in G Example Transformation Interactions.

I Applicability to Transforming Solutions which are Out of Scope (Non-Normative)

There are a number of well-known examples of solutions that seem to their users as though they are using a browser, but because the client software communicates with using proprietary protocols and techniques, it is the combination of the client and the network component that is regarded as the HTTP User Agent. The communication between the client and the network component is therefore out of scope of this document.

Additionally, where some kind of administrative arrangement exists between a transforming proxy and an origin server for the purposes of transforming content on the origin server's behalf, this is also out of scope of this document.

In both of the above cases, it is good practice to adhere to the provisions of this document in respect of providing information about the device and the original IP address.

J Scope for Future Work (Non-Normative)


The BPWG believes that POWDER will represent a powerful mechanism by which a server may express transformation preferences. Future work in this area may recommend the use of POWDER to provide a mechanism for origin servers to indicate more precisely which alternatives they have and what transformation they are willing to allow on them, and in addition to provide for Content Transformation proxies to indicate which services they are able to perform.

J.5 Amendment to and Refinement of HTTP

The BPWG believes that amendments to HTTP are needed to improve the interoperability of transforming proxies. For example, HTTP does not provide a way to distinguish between prohibition of any kind of transformation and the prohibition only of restructuring (and not recoding or compression).

At present HTTP does not provide a mechanism for communicating original header field values. The scheme based on X-Device prefixed fields described under 4.1.5 Alteration of HTTP Header Field Values records and clarifies an approach used to achieve this effect by some content transformation proxies. This scheme relies upon non-standard HTTP fields, which are identified by their prefix as experimental according to IETF standards (notably RFC 822 and RFC 2076), and are not included in the IANA registry of HTTP header fields. While the mechanism defined in that section, based on current practice, applies to conforming transformation proxy deployments, it is possible that in future, in collaboration with the IETF, this approach will be reconsidered. This implies that the specified X-Device prefixed fields may, at some time, become deprecated in favor of new equivalent fields, or that an entirely different approach will be taken to representing such values.

A number of mechanisms exist in HTTP which might be exploited given more precise definition of their operation - for example the OPTIONS method and the HTTP 300 (Multiple Choices) Status.

K Acknowledgments (Non-Normative)

The editor acknowledges contributions of various kinds from members of the Mobile Web Best Practices Working Group and earlier from the Content Transformation Task Force of that group.

The editor acknowledges significant written contributions from: