0

I will like to distribute a javascript file with several of my clients, they have several thousands of unique visits a day on their pages, so my file will be called a lot of times, i don't want that pressure on my web server, so i bought a CDN storage from RackSpace.

Since here everything is ok, but the URL of the file, my CDN gives me a very long URL i will like to shorten to something like js-api.mysite.com, so my clients can add that URL to their sites.

I'm not very clear about 2 things:

  1. What type of redirect should i use in order to maintain my web server completely out? (i can buy anther domain if necessary)
  2. My original long URL is serve in https, do I need to consider that on the selection of the type of redirect?
  • A CNAME record for what you want the short URL to be would suffice. – Nathan C Jul 2 '14 at 14:00
  • @NathanC Assuming the CDN provider allows it. – ceejayoz Jul 2 '14 at 14:01
  • @ceejayoz rackspace.com/knowledge_center/article/… ...:) – Nathan C Jul 2 '14 at 14:01
  • 1
    Unfortunately it doesn't serve HTTPS though... – Nathan C Jul 2 '14 at 14:02
  • @NathanC Neat. I've got more experience with AWS CloudFront, which requires some configuration on the CDN end to CNAME something. – ceejayoz Jul 2 '14 at 14:02
0

You're doing it wrong - source from the CDN directly.

You don't have to go any further than the page source of this page:

    <meta name="og:image" content="http://cdn.sstatic.net/serverfault/img/apple-touch-icon@2.png?v=9b1f48ae296b"/>
    <meta name="og:title" content="Redirect to a CDN" />
    <meta name="og:description" content="I will like to distribute a javascript file with several of my clients, they have several thousands of unique visits a day on their pages, so my file will be called a lot of times, i don&#39;t want that " />
    <meta name="og:url" content="http://serverfault.com/questions/609568/redirect-to-a-cdn"/>
    <link rel="canonical" href="http://serverfault.com/questions/609568/redirect-to-a-cdn" />



    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
    <script src="//cdn.sstatic.net/Js/stub.en.js?v=d142d951ee55"></script>
    <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/serverfault/all.css?v=01ae6db1af10">
| improve this answer | |
  • 2
    Rackspace doesn't support CNAMEs with https and their cloud "buckets" have annoyingly long hostnames – Nathan C Jul 2 '14 at 14:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.