Click here to Skip to main content
15,894,540 members

Comments by Nikunj_Bhatt (Top 1 by date)

Nikunj_Bhatt 19-Oct-11 7:14am View    
Deleted
[I had first posted this trick in The Launge, then a user told me to post this trick in this section.
Here is the URL of that entire thread: http://www.codeproject.com/Lounge.aspx?fid=1159&select=4056020&tid=4053506]

One user given this link regarding Content Negotiation system of Apache server on the above mentioned thread:
http://httpd.apache.org/docs/2.2/content-negotiation.html#better

The resource at there seems to be the reason behind omitting the file extension. But this feature depends on what the requesting browser can ACCEPT.

I looked at the HTTP_ACCEPT headers, they are as following:
FF: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
IE: text/html, application/xhtml+xml, */*
GC: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Op: text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/webp, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1
Sf: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5

Here we can see that FF, IE and GC have not provided anything regarding image accept type, while Op and Sf have given priority to PNG images. Now, FF, IE and GC have not provided any clue about image type than how the server decided to send PNG image to FF & IE and sent a JPEG image to GC? On the other hand, Op and Sf have image/png as first occurrence but they are displaying JPEG image!

On the content negotiation page, there is some important text about selecting media type based on the Quality factor, which is supplied in the HTTP_ACCEPT header with the option "q". IE is not supplying the quality factor but other browsers are, and they are almost similar!

Another thing that may apply to content negotiation is the Typemap file on server. This file lists media types and their Qualify (not Quality) Source factors (known as "qs") of most of media types. But this may not apply in this situation because if the qs factor is applied, the server would always send an image having the highest qs value; but this is not happening too!