Serving Fonts from Rackspace Cloud Files CDN will require extra X Header else you can not serve Font-Face and the TTF, EOT, OTF and WOFF Files. Here is how. We will give reference to only two older articles, there nearly a thousand articles only on Cloud Computing, you can either search this website (easy way) using the site Search function or can check the official documentation (for the developers). You can try to offload these files to Rackspace Cloud Files – definitely it will not work.
Serving Fonts from Rackspace Cloud Files CDN : Basics
You can try serving Fonts from Rackspace Cloud Files CDN including Font-Face and the TTF, EOT, OTF and WOFF Files, it will not work. Two important articles (and the relevant articles linked within those articles) related to this topic are :
- How To Use Any Web Font From Own Hosted Library
- Serving Full HTML Website From Rackspace Cloud Files CDN
As one can assume, the basics of serving Fonts from Rackspace Cloud Files CDN remains in the article named Serving Full HTML Website From Rackspace Cloud Files.
Serving Fonts from Rackspace Cloud Files CDN : Let us Go
First, check the normal Header response from your server for serving each files. You can use any online Free tool to check the Header Response or use cURL on *nix (UNIX or GNU Linux) system with this command :
curl -i http://example.com/wp/wp-content/themes/my-theme/fonts/font.ttf
You can check the cURL manual :
Windows users can follow this guide to install cURL or use any online tool. Now, if you check a image file’s header which is on Cloud Files, you will see that some of the headers are missing.
It is quite obvious, that if you add them manually from your Cloud Files account, you will able to get them served. For Apache server, we use this chunk of code to enable it :
# Apache config
Header set Access-Control-Allow-Origin "*"
#suppose you are ending here in the next line
Basically this never required for servers. But for CDN, we need to add as the content awareness mechanism, which adds a header automatically does not work. Do not ask me how this thing is automatically done – this is part of managing OpenStack Swift’s content policy. What we have seen that, the content awareness works for most of the files (for OTF, for example it works fine), sometimes extra headers are required to be added. Try this to cURL :
curl -i http://36b4b398438807f45c08-d307e5ed4df0e6ab544a0970868e062f.r15.cf2.rackcdn.com/SyrCOMUrhoyBold.otf
But heading to the url itself via browser will prompt you to download the font.
Also, see this document :
Follow the Author of this article :