sketch-city / harvey-api

Harvey Needs API
http://harveyneeds.org
GNU General Public License v3.0
23 stars 39 forks source link

Indexes and etags #113

Closed jwo closed 7 years ago

jwo commented 7 years ago

Adds indexes

You can use the If-Modified-Since header to check if there are any new results since that timestamp. If there are no new results, you'll receive a 304 NOT MODIFIED.

jwo commented 7 years ago

@cmason I seem to recall you did something with etags and stale results (304 NOT MODIFIED)... will you look this over? Things I'm wondering:

cmason commented 7 years ago

We might want to consider setting the Cache-Control header to public so the results can be cached by CDN's and proxy servers.

jwo commented 7 years ago

@cmason excellent feedback; believe I made it happen here.

I also found a bug where our near and limit aren't working nicely together. I investigatied moving to postgis (http://ngauthier.com/2013/08/postgis-and-rails-a-simple-approach.html) but found it wasn't warranted when I could hack together a take solution instead.