Startup hacks and engineering miracles from your exhausted friends at Faraday

State of caching in 2016: headers served by Google, Facebook, AWS

Seamus Abshere on

Recently I realized that our SPA app was misbehaving: our JS and CSS had cache-busting digests in the URLs, but browsers were caching the underlying index.html.

What do the big apps send?

Cache-Control Expires Pragma
AWS management console no-cache, no-store, must-revalidate -1 no-cache
Facebook private, no-cache, no-store, must-revalidate Sat, 01 Jan 2000 00:00:00 GMT no-cache
Google (the search engine) private, max-age=0 -1
gmail no-cache, no-store, max-age=0, must-revalidate Mon, 01 Jan 1990 00:00:00 GMT no-cache
Google Drive no-cache, no-store, max-age=0, must-revalidate Mon, 01 Jan 1990 00:00:00 GMT no-cache
Intercom max-age=0, private, must-revalidate
LinkedIn no-cache, no-store Thu, 01 Jan 1970 00:00:00 GMT no-cache

Implementation in nginx

In the end, I just went with nginx's default:

expires epoch;  

That produced

Cache-Control: no-cache  
Expires: Thu, 01 Jan 1970 00:00:01 GMT  

:D

Mountains of Census geodata for all

Bill Morris on

U.S. Census data gives our modeling a good predictive boost, and it's a robust quality assurance tool for all the third-party data we've got flowing through our wires.

The Census offers its geographic data in easy-to get, familiar formats via the TIGER portal, but distribution is split up by state for the largest datasets: blocks and block groups. There's a pretty simple reason for this: they're big. The census block shapefile for Indiana alone is 116MB compressed.

eastcoast

Ours is probably not a common use case, but we need all of the blocks and block groups in our database - merged, indexed and queryable. It took a significant amount of work to get them there, so in case anyone else needs them too, we're sharing national 2015 datasets in PostGIS dumpfile format, downloadable and ready to use here:


Census block groups

.pg_dump (426MB) | .sql (1.2GB) bg


Census blocks

.pg_dump (4.7GB) | .sql (12GB) b


Add these to your local PostgreSQL database like so:

pg_restore --no-owner --no-privileges --dbname <dbname> <filename>.pg_dump

# OR

psql <dbname> -f <filename>.sql  

To keep things simple, these are just geometries and GeoIDs (CREATE TABLE schemas can be perused here). Detailed analysis will require joining attributes separately.

Side note: I can't recommend censusreporter.org enough for census-based sanity checks.

Happy mapping!

The big picture: exportable maps

Bill Morris on

Today we're introducing exportable audience maps . . .

map

Do you use maps in your Faraday workflow? Prints? Presentations? Twitter? Let us know how these maps can help, and how we can improve them.

Getting a map image from the platform is now simple:

export

From any saved audience, just click the "Export" button and you'll be able to download a high-res image of the geography in context. Share it with colleagues and partners, add it to reports, or put it on your wall.

Cover letters are writing samples

Andy Rossmeissl on

Right, right, we know that cover letters are dead and that nobody reads them, etc.

Don't listen to these clowns. Whether you're hiring or applying, please don't skip the cover letter. That's because (repeat after me):

Cover letters are writing samples

In many cases it's the only shot you're going to get to prove (if you're applying) or learn (if you're hiring) that the candidate knows how to convey complex ideas (a whole person!) briefly and persuasively (you're selling yourself, after all).