Archive

Archive for February 9th, 2009

SimpleCDN CNAME Confusion

February 9th, 2009

I am using SimpleCDN to serve some static scripts and images of WordPress on my website.

Not like AWS CloudFront, Amazon’s CDN service, which only allows expiration date carried from S3 file meta. SimpleCDN supports fine tuning Expiration, P3P and gzip encoding through something called Pre-URL. Which look like these

http://s.mudy.info.simplecdn.net/
http://s.mudy.info-s1.simplecdn.net/
http://s.mudy.info-e7.simplecdn.net/

Here ‘-s1′ means special 1 with expire and gzip; ‘-e7′ means 10 years expire without gzip. And a lot more with different combo effects.

SimpleCDN also supports CNAME to any of these urls. Because there is not a lot document on how to use simplecdn. I mistakenly CNAMEed ’s.mudy.info’ to the first URL

s.mudy.info.simplecdn.net

Run my website through Yslow, I got a lot F score due to lack of expire headers and non-gzip on static files. I realize I have to use these different Pre-URLs in order to get http headers, so I substitute ’s.mudy.info’ in WordPress with ’s.mudy.info-s1.simplecdn.net’ or ’s.mudy.info-e7.simplecdn.net’. Originally very simple urls’ become long and urgly.

Due to some DNS setting error, I accidentally pinged 2 different SimpleCDN pre-urls. The results are 2 different IPs. I reallized I made another mistake today, these pre-urls are supposed to be used as CNAME to get different http headers and gzip encoding, because these hostname all has their own IPs. A quick testing I CNAME ’s.mudy.info’ to

s.mudy.info-s1.simplecdn.net

which gives nicely gzipped files with correct expiration settings.

This design is what I initially did not expect. Because traditional CDN usually use HTTP hostname to distinguish objects, so I normally would think I have to use different hostnames. However SimpleCDN use anycast , so they use same IP block on on all edge servers, which make it possible to use different IP addresses to distinguish requests.

Bookmark and Share  
 

Yejun Web , ,

Using tinydns wildcards with cautions

February 9th, 2009

Tinydns support wildcards. However I just made a mistake make my own website inaccessible.

I was pointing all subdomains to a single host including this website.

C*.mudy.info:nw.mudy.info:1200

It worked perfect fine, until today I encounter a website which requires myn...@blog.mudy.info to verify ownership. I know it should just working without any further settings, however to be nice I added an additional mx record to my Tinydns to explicitly indicates the mail host of blog.mudy.info

@blog.mudy.info::nw.mudy.info.:5:1200

After that my website become inaccessible. Apparently tinydns will stop looking into data once a matching name found, even though the record type does not match and there are better matching wildcards.

To fix this, I added another explicit A record.

+blog.mudy.info:66.246.138.44:1200

CNAME record will work as well.

Bookmark and Share  
 

Yejun Linux , , , ,