A simple node/express app for finding locations that accept WIC in California, using data from the new California Department of Public Health open data portal.
Fixes #18. Caches geolocation result to localStorage for ~24 hours.
NOTE:This isn't quite ready to be merged (there's a bug in Safari I need to look into), but I thought I'd get feedback about the approach, like using localStorage as opposed to cookies or another session storage method.
This wouldn't need to be localStorage (interested to hear your thoughts) but here's my reasoning:
Generic session storage can be kept in cookies, server memory, or another datastore, but usually involves either (a) including it in the page body or (b) making an AJAX request for that data. Since (a) would break any future possibility of using a CDN like CloudFlare to add caching or HTTPS, and (b) would dramatically slow down the pageload, it might be better to keep this client-side.
Cookies have rather particular encoding needs (no semicolons, commas, or whitespace) so we'd probably want to use one of the jQuery cookie plugins if we went that route. Plugins are meh.
LocalStorage is supported on all browsers that support the geolocation API (as far as I know), and doesn't require any plugins.
Fixes #18. Caches geolocation result to localStorage for ~24 hours.
NOTE: This isn't quite ready to be merged (there's a bug in Safari I need to look into), but I thought I'd get feedback about the approach, like using localStorage as opposed to cookies or another session storage method.This wouldn't need to be localStorage (interested to hear your thoughts) but here's my reasoning: