Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 973897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:20:56+00:00 2026-05-16T03:20:56+00:00

Let’s say I’ve designed a media type which is a strict subset of another

  • 0

Let’s say I’ve designed a media type which is a strict subset of another media type. For example, my media type is application/vnd.example.foo+xml (hereafter abbreviated foo+xml). This media type is a strict subset of the application/xhtml+xml (hereafter abbreviated xhtml) media type. Basically my media type definition adds additional processing instructions (or replaces them completely) to certain constructs within the xhtml media type. For the sake of example, it could say that in any foo+xml documents, the xpath //ul[@class='foo']/li[a] shall be shown in a specific way by clients, and the rest of the document shall be ignored, a processing model which is quite different from that of the original xhtml media type.

Armed with this information, the server can now start creating representations of that type, and my clients can pass Accept headers and happily consume this type of document, both of them honoring the processing instructions laid out in my type definition. However, it’s a custom media type which I can’t assume anyone will know how to process.

An option that I have is this:

  • When a client prefers the foo+xml media type, I serve the document with a Content-Type set to that media type.
  • When a client prefers the xhtml media type, I serve the same document with an xhtml Content-Type header

This means that generic clients that don’t know what foo+xml but likely understand what xhtml is can still process my document, follow links to other resources, present it to users in a generic fashion and so on. Likewise, a client that knows the semantics of foo+xml can actually get a confirmation that this document is actually just that, instead of having to guess or introspect the document to see if it at all looks like something it can process (e.g. via HTML profiling, microformats, etc.).

  1. What are the pros and cons of doing this
  2. Is there prior art that echoes this technique?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T03:20:57+00:00Added an answer on May 16, 2026 at 3:20 am

    Although I have never seen any authoritative discussion on this particular issue I would say it seems perfectly valid. It is similar to the idea of requesting text/plain for an HTML document to effectively do a view source operation.

    From the client’s perspective, it has no idea that the bytes are identical to another representation, so I cannot see how there could be pros or cons for the client.

    I guess the tricky issue comes with caching. Are you going use the same URI to return both representations, or are you going to redirect from the generic URI to ones specific to the representation? Will there be one or two copies of the bytes in the cache? Do you need to set the Vary header to vary on Content-type? Can you live with two copies in the cache? Do you need to do updates on one or both of these representations? If so, will the cache invalidate both copies if they exist?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I'm writing a Windows Forms (.NET Framework 3.5) application which shows the
Let's say I'm building a data access layer for an application. Typically I have
Let's say you have a class called Customer, which contains the following fields: UserName
Let's say I have the string: hello world; some random text; foo; How could
Let's say I have a main folder in my website named test which contains
Let's say I have a dataset, which can be neatly classified using weka's J48
Let's say I have two assemblies: BusinessLogic and Web. BusinessLogic has an application setting
Let's say I have this MySQL table: OK.. see the type field? Type 0
Let's say for example i have URL containing the following percent encoded character :
Let's say we have a template class Area , which has a member variable

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.