Skip to content

Instantly share code, notes, and snippets.

In many websites, there are static portions of the page such as the navigation or header that rarely change. If we could deliver the markup for navigation, the experience would feel a bit snappier while the rest of the page is generated.

Try running this snippet in node and visit localhost:3000/incremental and localhost:3000/blocking. These are pretty trivial examples but we could cache and immediately send the nagivation bar and `` elements for every request.

route({
'GET /': service.get,
'GET /session': session.get,
'SET /session': session.set,
'GET /products': products.list,
'GET /products/:pid': products.get,
'DEL /products/:pid': products.del
});
var service = {
@jrf0110
jrf0110 / Retinafy.md
Created July 24, 2012 02:47 — forked from nijikokun/Retinafy.md
Retinafy your site, a free book

Retinafy Your Site / Device

By Nijiko Yonskai

=====

I made a book, its one page.

Why Use Larger Images?

Higher resolution, twice the size, more detail, better experience on a device that provides it. There is also that thing where people make the desktop version and go to mobile more often than they do the reverse, why? Because, people like making complicated stuff first.

@jrf0110
jrf0110 / LICENSE.txt
Created May 24, 2011 17:59 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@jrf0110
jrf0110 / LICENSE.txt
Created May 24, 2011 17:57 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE