Skip to content

Instantly share code, notes, and snippets.

@dangrossman
Last active August 29, 2015 14:16
Show Gist options
  • Save dangrossman/dfb1834daefd23333301 to your computer and use it in GitHub Desktop.
Save dangrossman/dfb1834daefd23333301 to your computer and use it in GitHub Desktop.
<!-- Include Required Prerequisites -->
<script type="text/javascript" src="//cdn.jsdelivr.net/jquery/2.1.3/jquery.min.js"></script>
<script type="text/javascript" src="//cdn.jsdelivr.net/momentjs/2.9.0/moment.min.js"></script>
<link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/bootstrap/3.3.2/css/bootstrap.css" />
<!-- Include Date Range Picker -->
<script type="text/javascript" src="//cdn.jsdelivr.net/bootstrap.daterangepicker/1/daterangepicker.js"></script>
<link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/bootstrap.daterangepicker/1/daterangepicker-bs3.css" />
@thekondrashov
Copy link

To load all these files you only need 2 request (plus other possible improvements: set path to minified version of bootstrap css, update jquery, boostrap & moment versions, remove type attributes (here why), always use https (here why)):

<!-- include all styles -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/g/bootstrap@3.3.4(css/bootstrap.min.css),bootstrap.daterangepicker@1(daterangepicker-bs3.css)">
<!-- include all scripts -->
<script src="https://cdn.jsdelivr.net/g/jquery@2.1.4,momentjs@2.10.3,bootstrap.daterangepicker@1"></script>

"The first 3-4 requests will be slower, as they are not yet cached. Afterwards, these dynamic files get cached and become static files (same as all others)."
jsDelivr CDN docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment