Difference between revisions of "CDN Transfer Layer"
Jump to navigation
Jump to search
(New page: ==The CDN HTTP Interface== There are three different types of requests ===Name Lookups=== A name lookup is an HTTP HEAD request that, given a named file, will return metadata. Example: cu...) |
|||
(One intermediate revision by the same user not shown) | |||
Line 3: | Line 3: | ||
===Name Lookups=== | ===Name Lookups=== | ||
A name lookup is an HTTP HEAD request that, given a named file, will return metadata. Example: | A name lookup is an HTTP HEAD request that, given a named file, will return metadata. Example: | ||
− | curl -v --head http://cdn.sirikata.com/dns/global | + | curl -v --head http://cdn.sirikata.com/dns/global/jkusnerz/Boulder_Spire_01.mesh |
− | > HEAD /dns/global | + | > HEAD /dns/global/jkusnerz/Boulder_Spire_01.mesh HTTP/1.1 |
> User-Agent: curl/7.19.7 (x86_64-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15 | > User-Agent: curl/7.19.7 (x86_64-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15 | ||
> Host: cdn.sirikata.com | > Host: cdn.sirikata.com | ||
Line 11: | Line 11: | ||
HTTP/1.1 200 OK | HTTP/1.1 200 OK | ||
− | Date: Fri, 18 Jun 2010 18: | + | Date: Fri, 18 Jun 2010 18:34:25 GMT |
Server: Apache/2.2.3 (CentOS) | Server: Apache/2.2.3 (CentOS) | ||
X-Powered-By: PHP/5.1.6 | X-Powered-By: PHP/5.1.6 | ||
Line 18: | Line 18: | ||
File-Size: 11650 | File-Size: 11650 | ||
Content-Type: text/html; charset=UTF-8 | Content-Type: text/html; charset=UTF-8 | ||
+ | |||
===File Metadata=== | ===File Metadata=== | ||
You can also do an HTTP HEAD request to get metadata for a hash directly. Example: | You can also do an HTTP HEAD request to get metadata for a hash directly. Example: | ||
Line 53: | Line 54: | ||
Content-Type: text/html; charset=UTF-8 | Content-Type: text/html; charset=UTF-8 | ||
− | < | + | <500 bytes of binary data> |
Latest revision as of 18:35, 18 June 2010
The CDN HTTP Interface
There are three different types of requests
Name Lookups
A name lookup is an HTTP HEAD request that, given a named file, will return metadata. Example:
curl -v --head http://cdn.sirikata.com/dns/global/jkusnerz/Boulder_Spire_01.mesh
> HEAD /dns/global/jkusnerz/Boulder_Spire_01.mesh HTTP/1.1 > User-Agent: curl/7.19.7 (x86_64-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15 > Host: cdn.sirikata.com > Accept: */*
HTTP/1.1 200 OK Date: Fri, 18 Jun 2010 18:34:25 GMT Server: Apache/2.2.3 (CentOS) X-Powered-By: PHP/5.1.6 Accept-Ranges: bytes Hash: ddde4f8bed9a8bc97d8cbd4137c63efd5e625fabbbe695bc26756a3f5f430aa4 File-Size: 11650 Content-Type: text/html; charset=UTF-8
File Metadata
You can also do an HTTP HEAD request to get metadata for a hash directly. Example:
curl -v --head http://cdn.sirikata.com/files/global/ddde4f8bed9a8bc97d8cbd4137c63efd5e625fabbbe695bc26756a3f5f430aa4
> HEAD /files/global/ddde4f8bed9a8bc97d8cbd4137c63efd5e625fabbbe695bc26756a3f5f430aa4 HTTP/1.1 > User-Agent: curl/7.19.7 (x86_64-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15 > Host: cdn.sirikata.com > Accept: */*
HTTP/1.1 200 OK Date: Fri, 18 Jun 2010 18:11:59 GMT Server: Apache/2.2.3 (CentOS) X-Powered-By: PHP/5.1.6 Accept-Ranges: bytes Content-Length: 11650 Content-Type: text/html; charset=UTF-8
File Download
Once the hash is known, you can download the file, and range requests are supported. Example:
curl -v --range 500-999 http://cdn.sirikata.com/files/global/ddde4f8bed9a8bc97d8cbd4137c63efd5e625fabbbe695bc26756a3f5f430aa4
> GET /files/global/ddde4f8bed9a8bc97d8cbd4137c63efd5e625fabbbe695bc26756a3f5f430aa4 HTTP/1.1 > Range: bytes=500-999 > User-Agent: curl/7.19.7 (x86_64-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15 > Host: cdn.sirikata.com > Accept: */*
HTTP/1.1 200 OK Date: Fri, 18 Jun 2010 18:16:36 GMT Server: Apache/2.2.3 (CentOS) X-Powered-By: PHP/5.1.6 Accept-Ranges: bytes Content-Length: 500 Content-Range: bytes 500-999/11650 Content-Type: text/html; charset=UTF-8
<500 bytes of binary data>