EzDevInfo.com

cdn interview questions

Top cdn frequently asked interview questions

backbone.js & underscore.js CDN recommendation?

Is there any CDN sources for backbone.js and also underscore.js to use in our projects?


Source: (StackOverflow)

Why should I use Google's CDN for jQuery?

This may be obvious to some, but I've been wondering: why should I depend on Google's server to host jQuery for my site?

Is it only because it loads faster this way?


Source: (StackOverflow)

Advertisements

Force CloudFront distribution/file update

I'm using Amazon's CloudFront to serve static files of my web apps.

Is there no way to tell a cloudfront distribution that it needs to refresh it's file or point out a single file that should be refreshed?

Amazon recommend that you version your files like logo_1.gif, logo_2.gif and so on as a workaround for this problem but that seems like a pretty stupid solution. Is there absolutely no other way?


Source: (StackOverflow)

Downloading jQuery UI CSS from Google's CDN

I am planning on using Google to download the jQuery lib for both UI and Core. My question is, do they allow me to download the CSS for it or should I have to host it myself?

Also if I use Google to load how should I load other plugins? Can I compress all plugins together or should it be its own separate file?


Source: (StackOverflow)

Best way to use Google's hosted jQuery, but fall back to my hosted library on Google fail

What would be a good way to attempt to load the hosted jQuery at Google (or other Google hosted libs), but load my copy of jQuery if the Google attempt fails?

I'm not saying Google is flaky. There are cases where the Google copy is blocked (apparently in Iran, for instance).

Would I set up a timer and check for the jQuery object?

What would be the danger of both copies coming through?

Not really looking for answers like "just use the Google one" or "just use your own." I understand those arguments. I also understand that the user is likely to have the Google version cached. I'm thinking about fallbacks for the cloud in general.


Edit: This part added...

Since Google suggests using google.load to load the ajax libraries, and it performs a callback when done, I'm wondering if that's the key to serializing this problem.

I know it sounds a bit crazy. I'm just trying to figure out if it can be done in a reliable way or not.


Update: jQuery now hosted on Microsoft's CDN.

http://www.asp.net/ajax/cdn/


Source: (StackOverflow)

Loading Bootstrap from CDN with Require.js

Bootstrap is distributed in CDN in

http://www.bootstrapcdn.com/

  • Is it possible to load Bootstrap with Require.JS 2.x (shimmed or native AMD)?

  • How it is possible to load Bootstrap, or any minified JS, directly from CDN URL with Require.js


Source: (StackOverflow)

Is there a publicly available CDN that hosts JSON2?

It's well known that Google and Microsoft host several common javascript libraries on their CDNs (content distribution networks). Unfortunately neither seems to host JSON2.js.

I'm aware that I could upload a copy of JSON2.js to my server and serve it myself, but there are a number advantages CDNs offer that I would like to take advantage of.

So with that in mind, are there any publicly available CDNs that host JSON2? If not, any idea why? Is there some sort of copyright reason?


Source: (StackOverflow)

How to fallback to local stylesheet (not script) if CDN fails

I am linking to the jQuery Mobile stylesheet on a CDN and would like to fall back to my local version of the stylesheet if the CDN fails. For scripts the solution is well known:

<!-- Load jQuery and jQuery mobile with fall back to local server -->
<script src="http://code.jquery.com/jquery-1.6.3.min.js"></script>
<script type="text/javascript">
  if (typeof jQuery == 'undefined') {
    document.write(unescape("%3Cscript src='jquery-1.6.3.min.js'%3E"));
  }
</script>

I would like to do something similar for a style sheet:

<link rel="stylesheet" rel='nofollow' href="http://code.jquery.com/mobile/1.0b3/jquery.mobile-1.0b3.min.css" />

I am not sure if a similar approach can be achieved because I am not sure whether the browser blocks in the same way when linking a script as it does when loading a script (maybe it is possible to load a stylesheet in a script tag and then inject it into the page) ?

So my question is: How do I ensure a stylesheet is loaded locally if a CDN fails ?


Source: (StackOverflow)

Is there a Content Delivery Network (CDN) that hosts Google Code Prettify?

Is there a content delivery network (CDN) that is hosting google-code-prettify?

I am putting together a blog on TypePad and would like to take advantage of a CDN if possible.


Source: (StackOverflow)

Multiple files on CDN vs. one file locally

My website uses about 10 third party javascript libraries like jQuery, jQuery UI, prefixfree, a few jQuery plugins and also my own javascript code. Currently I pull the external libraries from CDNs like Google CDN and cloudflare. I was wondering what is a better approach:

  1. Pulling the external libraries from CDNs (like I do today).
  2. Combining all the files to a single js and a single css file and storing them locally.

Any opinions are welcome as long as they are explained. Thanks :)


Source: (StackOverflow)

Benefits vs. Pitfalls of hosting jQuery locally

We're currently pulling jQuery and jQueryUI (and jQueryUI CSS) libraries from the google CDN. I like this because I can call google.load("jquery", "1");
and the latest jQuery 1.x.x will be used.

Now I am to pull the libraries locally because of security.

I'm happy to pull them locally but I'm wondering what are some of the other benefits and pitfalls to watch out for?


Source: (StackOverflow)

Bootstrap 3 Glyphicons CDN

PAY ATTENTION!

The Bootstrap icons are back after this pull request merge.


After going back and forth on this for the last couple weeks, I've decided to restore the Glyphicons icon font to the main repo. Given how prevalent icons are in UIs, it's probably a disservice to most folks to not include them (or some other icon font) in the same spot as the CSS and JS.

With this update comes the following:

  • Restores documentation (on the Components page)
  • New variables, @icon-font-path and @icon-font-name, for flexibility in adding and removing icon fonts
  • Upgrades to latest Glyphicons (adding 40 new icons)
  • Removes the old Glyphicons mention from the CSS page

We'll work on improving the customization of icon fonts in the future so swapping font libraries can be easier (which was the whole motivation for the original removal).


Which is the CDN url of the new version of Twitter Bootstrap Glyphicons?

From the Bootstrap 3 they were moved into a separate repository, but I didn't find any CDN.

From the official documentation:

With the launch of Bootstrap 3, icons have been moved to a separate repository. This keeps the primary project as lean as possible, makes it easier for folks to swap icon libraries, and makes Glyphicons icon fonts more readily available to more people outside Bootstrap.

On the official website they don't provide a CDN url for icons.

Where can find it? I don't want to download the repository and include it into my project.


Source: (StackOverflow)

Is there a CDN which provides on-demand image resizing, cropping, sharpening, etc? [closed]

For years I have wished that Amazon would create an add-on service that would allow me to request modified versions of an image on the fly based on querystring values.

<img src="http://bucket.s3.amazonaws.com/image.jpg?maxwidth=200&sharpen=.5" />

Does anyone know if there is a CDN that provides this type of functionality?

I love the Asp.net Image Resizer created by Nathanael Jones, but I am looking for something like this built into a CDN.

UPDATE: A year later, I have found what I was looking for.

http://imageresizing.net/ (the updated version of the Asp.net Image Resizer) is freaking amazing. It now integrates with external image repositories (S3, CloudFront, Azure, SQL server) and basically does everything I was looking for when I asked this question.


Source: (StackOverflow)