TalAter /UpUp
✈️ Easily create sites that work offline as well as online
★ 4,923⑂ 259👁 95⑃ 75● 98▤ 6
4,923
stars
259
forks
95
watchers
75
prs
98
issues
6
releases
README
UpUp - Kickstarting the Offline First Revolution
UpUp is a tiny JavaScript library that makes sure your users can always access your site's content, even when they're on a plane, in an elevator, or 20,000 leagues under the sea.
Mobile-First has become the de-facto standard for building modern sites. But in a world where everyone is mobile, an always-on connection isn't something we can rely on. It's time to start thinking Offline First.
With UpUp you control the content your users see, even when they are offline. And you can do it with just a single JavaScript command.
Demo & Tutorial
The easiest path to understanding is to see UpUp in action and try a quick tutorial.
Hello World
Getting started with UpUp is as easy as adding two JavaScript files to your site, upup.min.js & upup.sw.min.js, and defining the content you want your users to see when they are offline.
For example:
html
UpUp.start({
'content-url': 'offline.html',
'assets': ['/img/logo.png', '/css/style.css', 'headlines.json']
});
Now every time your users return to your site and their connection is down, they will see the contents of offline.html instead of an error.
Check out some live demos and a full tutorial. Once you're up and rolling, you can read the full API Docs.
HTTPS Requirement
UpUp requires a secure connection to your site (this is a requirement of service workers, the technology at the heart of UpUp). So make sure your users visit your site over HTTPS (an SSL certificate is free with Let’s Encrypt or via CloudFlare).
Browser Support
UpUp works in any browser that supports service workers. Currently this means:
Chrome 40+
Opera 27+
Firefox 41+
If your users are using a different or older browser, they will simply be unaffected by UpUp. Nothing will break, and they simply won't notice anything different.
Technical Documentation and API
Docs and full API reference
Author
Tal Ater: @TalAter
License
Licensed under MIT.Top issues
#49Consider removing need to explicitly state assets needed4 comments · 2015-09-04#42Offline page should periodically test for restored connection4 comments · 2015-09-01#138Using UpUp with an .htaccess authentification3 comments · 2019-06-10#34Allow caching assets to speed up online site as well3 comments · 2015-08-17#9Allow storing different content for different areas of the site3 comments · 2015-03-14#1Allow site to ask UpUp if offline mode is available3 comments · 2015-03-11#114Uncaught (in promise) TypeError: Request failed on load2 comments · 2017-04-22#38Change script to load async2 comments · 2015-08-31
Latest release
Added support for custom scopes (fully backwards compatible) v1.1.0 2018-12-21👍 This release is 100% backwards compatible
[Added] Allow defining a custom scope for UpUp
By passing a scope setting to either the addSettings() or start() functions, you can limit the scope for which UpUp will serve offline content.
For example the following code will only serve offline.html in response to requests within the blog subdirectory, even if the code is placed in the root directory.
javascript
UpUp.start({
'content-url': '/blog/offline.html',
'assets': ['/blog/img/logo.png', '/blog/css/style.css'],
'scope': '/blog/'
});
❤️ Credits goes to @cspiker for