Closed jwo closed 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:
Shelter.maximum(:updated_at)
rather than the @shelters.maximum(:updated_at)
--- I was worried about the filters.We might want to consider setting the Cache-Control
header to public so the results can be cached by CDN's and proxy servers.
@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.
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 a304 NOT MODIFIED
.