⚠️ Note 2023-01-21
Some things have changed since I originally wrote this in 2016. I have updated a few minor details, and the advice is still broadly the same, but there are some new Cloudflare features you can (and should) take advantage of. In particular, pay attention to Trevor Stevens' comment here from 22 January 2022, and Matt Stenson's useful caching advice. In addition, Backblaze, with whom Cloudflare are a Bandwidth Alliance partner, have published their own guide detailing how to use Cloudflare's Web Workers to cache content from B2 private buckets. That is worth reading,
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///////////////////////////////////////////////// | |
//// Minimal routing library (IE10+) | |
///////////////////////////////////////////////// | |
// Listen to url changes: | |
// route(function(param, param...){}) - will get /param/param, split as arguments | |
// Navigate to path: | |
// route.to(path) - redirect to new path | |
// route.to(path, true) - redirect to new path, replacing current url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///////////////////////////////////////////////// | |
//// Simple minimal router (works in IE9+) | |
///////////////////////////////////////////////// | |
/*** Usage ************************************** | |
//// Navigate to url | |
route('/path') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// _easing.scss, CSS easing functions - gist.github.com/terkel/4377409 | |
// Based on Caesar - matthewlein.com/ceaser | |
$linear: cubic-bezier( 0.250, 0.250, 0.750, 0.750 ); | |
$ease: cubic-bezier( 0.250, 0.100, 0.250, 1.000 ); | |
$ease-in: cubic-bezier( 0.420, 0.000, 1.000, 1.000 ); | |
$ease-out: cubic-bezier( 0.000, 0.000, 0.580, 1.000 ); | |
$ease-in-out: cubic-bezier( 0.420, 0.000, 0.580, 1.000 ); | |
$ease-in-quad: cubic-bezier( 0.550, 0.085, 0.680, 0.530 ); |