views:

181

answers:

2

I want my site to use URLs like http://2.2.2.2/... and https://2.2.2.2/... for static content to avoid unnecessary cookies in request AND avoid additional DNS request.

Is there any way to obtain SSL cert for this purpose?

+3  A: 

According to this answer, it is possible, but rarely used.

As for how to get it: I would tend to simply try and order one with the provider of your choice, and enter the IP address instead of a domain during the ordering process.

However, running a site on an IP address to avoid the DNS lookup sounds awfully like unnecessary micro-optimization to me. You will save a few milliseconds at best, and that is per visit, as DNS results are cached on multiple levels.

I'm don't think your idea makes sense from an optimization viewpoint.

Pekka
AFAIK, 1 time per minute (Firefox DNS cache) and 1 time per 30 minutes for IE. This differs from TTL of DNS records.Also it takes about 20ms for me, depending on domain and how fast are NS servers (which are also to be resolved first :) )I also want to avoid my lengthy cookies (my auth + Google Analytics cookies) for each static request. So using IP instead of purchasing separate domain is good.BTW, stackoverflow, basecamphq use separate domain for static content. Using IP instead will remove unnecessary DNS request(s) also.
Evgenyt
I absolutely see your point with the cookies, you're totally right. But to switch to a SSL IP to save the few ms of DNS lookup sounds more hassle to me than it's worth. Plus, you may have issues taking your IP with you if you ever have to change your provider - it's probably not possible. Moving a domain is much easier, and it should be possible to move a certificate with it halfway easily.
Pekka
Google's Page Speed tool always suggests to "Serve the following JavaScript resources from the same host as the main document (xxxx.com), or defer loading of these resources if possible". I'm not rating Page Speed tool as bible, but anyway that means DNS optimization was not invented by me. I'm just trying to make my Page Speed checklist green where possible.
Evgenyt
+2  A: 

The answer I guess, is yes. Check this link for instance.

klausbyskov