Content-type: image/svg+xml

In the interest of getting the ball rolling (trying to avoid a chicken-and-egg scenario here in the forums), I thought I'd see if there are any thoughts about how content-type is used/not used by current SVG-capable browsers and plugins. You can reference this post by Ian Hickson for some context.

  • It seems that Adobe SVG Viewer doesn't care about the Content-type sent in the HTTP header, it looks like the filename extension (.svg) is the big deciding factor.
  • Firefox cares about the Content-type. In fact, it will not render an SVG file that does not get served with the proper MIME type (even with the extension as .svg)
  • Opera goes with the extension approach (doesn't require proper MIME type in the header), but I'm not clear if Opera would render an SVG file that was served with the proper content-type and its file extension was not .svg.

What do other implementations (Safari, Konqueror) do? We're now in a mode where we have to convince servers to serve the proper MIME type for SVG content that already works fine in ASV and Opera to display properly in Mozilla. Is this a losing battle for Mozilla? It seems to hurt SVG adoption in the short run.

In light of the current state of affairs (see Ian's tests in the above post), is being strict about Content-type important?

Comments

Firefox (1.5.0.2) seems to

Firefox (1.5.0.2) seems to do pretty well according to his tests, except for the images.

It seems to be another case of the de-facto standard (sniffing) being at odds with the written standard (Content-Type). I remember reading similar complaints about RSS files a while back when everyone was still figuring out how to provide a feed.

I don't think it's realistic to go back and be strict about Content Type for those that have already been "corrupted" but there's still a chance for SVG. If they stick to their guns for the first couple versions with SVG, then they can always add sniffing in afterward if it becomes an issue. If they start sniffing right now, then they've given up one easy method that they can never ask developers to do for them later.

Defacto

Yes, but ASV already has a (relatively) large footprint. Couple that with Opera's decision and Mozilla is in the minority...

Yeah, I don't think Mozilla

Yeah, I don't think Mozilla can stick to just the Content Type header forever, but for now I think they're making things easier on themselves in the future. That is to say, sniffing will work better later since there will be fewer sites that it needs to be done for.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Post new comment

  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.