Does File Extensions Matter For Browsers?
Solution 1:
No, what matters is the Content-Type header, which gets served in the HTTP response.
Solution 2:
It probably does not matter (see other answers).
Having that said, why NOT keeping the filename extension? It will make your page source much more readable, and you'll easily understand the file types stored at the server.
Even if there are no technical reasons for that, it is a very good practice to keep each file with a meaningful extension. Likewise, I guess you can save your .c
, .h.
and .py
files without extensions. They'll compile and run, but it would just make your life a whole lot harder.
Solution 3:
In theory, what matters is the Content-Type header, as Anton pointed out.
However, in practice, at least Internet Explorer will in some cases try to "guess" the MIME type, even if it is specified in the Content-Type header. Then the filename is one of the things considered. This should however only apply in some special cases.
See here: http://msdn.microsoft.com/en-us/library/ms775147%28VS.85%29.aspx
Solution 4:
Nope. Only the MIME type in the response matters, and sometimes not even that.
Solution 5:
For images it doesn't really matter since they use the mime-type. But the fact that you're asking means that even you think it's slightly confusing. This also assumes some mod_rewrite foo or you're loading the images through your framework which is going to cost you some performance.
Post a Comment for "Does File Extensions Matter For Browsers?"