tgvashworth / pldn.io

All your front–end dependencies via one script tag. Minified, concatenated and cached.
http://js.pldn.io/
54 stars 3 forks source link

pldn.io

<script src="https://github.com/tgvashworth/pldn.io/raw/master//js.pldn.io/html5shiv/jquery@1.9.1/underscore"></script>

js.pldn.io is pulldown for the client side. That means you get:

  1. All your front–end dependencies in in one script tag.
  2. They're minified, concatenated and cached (we Do The Right Thing™ so you don't have to worry)
  3. New libraries at your finger-tips (you just need to know the name)

Sweet, huh?

Usage

It's mind-blowingly simple. Just add a script tag to your page, pointing to js.pldn.io:

<script src="https://github.com/tgvashworth/pldn.io/raw/master//js.pldn.io/"></script>

Then add library names. We get these for you from CDNjs.

<script src="https://github.com/tgvashworth/pldn.io/raw/master//js.pldn.io/jquery/underscore/backbone"></script>

You can even specify a specific version!

<script src="https://github.com/tgvashworth/pldn.io/raw/master//js.pldn.io/jquery@1.9.1"></script>

Who should use this?

People who's sites have a small set of dependencies, and who don't have the resources or specialist knowledge, or time, to do the right thing with concatenation, minification, caching and delivery.

Anything else?

There's probably more – if you have a question, ask it in an issue.

Technical Overview

pld.io works something like the following:

Technology In place? Purpose
CDN Yes We use Amazon's CloudFront CDN for geographical distribution as close to you and your users as possible, optimizing performance.
Agressive HTTP caching Yes The same URL (say /jquery@1.9.1/underscore) will, for a long period of time, always produce the same output – so we set far future cache headers to make sure the result is saved in the browser's HTTP cache.
pldn.io cache Yes We cache recently used URLs, so if the CDN doesn't have it, we might!
pldn.io server Yes This is main bit of pldn, finding the libraries you need and building a file. It
pldn.io package cache No We will cache the contents of specific libraries to make pldn even faster.
Pulldown Yes Pulldown accepts a list of identifiers (like jquery and backbone), and converts them into URLs for those libraries on a CDN by hitting the Pulldown API.
Pulldown API Yes The Pulldown API resolves identifiers to URLs using pulldown-resolve. This actually defers to CDNJS, but this dependency can be changed or improved in future.
CDNjs Yes As mentioned above, Pulldown gets its libraries from CDNjs, although this could be added to or improved in future.

Notes

Feedback

Tweet to @phuunet, or open an issue.

License

MIT, yo.