{"action":"created","issue":{"url":"https://api.github.com/repos/artsy/metaphysics/issues/106","repository_url":"https://api.github.com/repos/artsy/metaphysics","labels_url":"https://api.github.com/repos/artsy/metaphysics/issues/106/labels{/name}","comments_url":"https://api.github.com/repos/artsy/metaphysics/issues/106/comments","events_url":"https://api.github.com/repos/artsy/metaphysics/issues/106/events","html_url":"https://github.com/artsy/metaphysics/pull/106","id":131496531,"number":106,"title":"@craigspaeth: User authentication; BidderPositions... etcetera","user":{"login":"dzucconi","id":112297,"avatar_url":"https://avatars.githubusercontent.com/u/112297?v=3","gravatar_id":"","url":"https://api.github.com/users/dzucconi","html_url":"https://github.com/dzucconi","followers_url":"https://api.github.com/users/dzucconi/followers","following_url":"https://api.github.com/users/dzucconi/following{/other_user}","gists_url":"https://api.github.com/users/dzucconi/gists{/gist_id}","starred_url":"https://api.github.com/users/dzucconi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dzucconi/subscriptions","organizations_url":"https://api.github.com/users/dzucconi/orgs","repos_url":"https://api.github.com/users/dzucconi/repos","events_url":"https://api.github.com/users/dzucconi/events{/privacy}","received_events_url":"https://api.github.com/users/dzucconi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-02-04T22:45:49Z","updated_at":"2016-02-05T17:41:37Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/artsy/metaphysics/pulls/106","html_url":"https://github.com/artsy/metaphysics/pull/106","diff_url":"https://github.com/artsy/metaphysics/pull/106.diff","patch_url":"https://github.com/artsy/metaphysics/pull/106.patch"},"body":"I want to be able to fetch user authenticated stuff along-side non-authenticated stuff that's cached.\r\n\r\nI'm not that happy with how I resolved this but it does the job for now.\r\n\r\nSince we don't leverage caching on any unauthenticated stuff then this will get slow if you try to orchestrate a ton of things, so beware.\r\n\r\n![](http://static.damonzucconi.com/_capture/kaAQ9nWBTJ.png)\r\n\r\nyields:\r\n\r\n```\r\n# Cached\r\ninfo Loading: sale/los-angeles-modern-auctions-march-2015...\r\ninfo Elapsed: 0s 5.736123ms - sale/los-angeles-modern-auc...\r\ninfo Loading: sale/los-angeles-modern-auctions-march-2015...\r\ninfo Elapsed: 0s 6.056311ms - sale/los-angeles-modern-auc...\r\n\r\n# Uncached\r\ninfo Loading: me/bidder_positions?artwork_id=ed-ruscha-co...\r\ninfo Elapsed: 0s 266.647497ms - me/bidder_positions?artwo...\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/artsy/metaphysics/issues/comments/180461199","html_url":"https://github.com/artsy/metaphysics/pull/106#issuecomment-180461199","issue_url":"https://api.github.com/repos/artsy/metaphysics/issues/106","id":180461199,"user":{"login":"craigspaeth","id":555859,"avatar_url":"https://avatars.githubusercontent.com/u/555859?v=3","gravatar_id":"","url":"https://api.github.com/users/craigspaeth","html_url":"https://github.com/craigspaeth","followers_url":"https://api.github.com/users/craigspaeth/followers","following_url":"https://api.github.com/users/craigspaeth/following{/other_user}","gists_url":"https://api.github.com/users/craigspaeth/gists{/gist_id}","starred_url":"https://api.github.com/users/craigspaeth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/craigspaeth/subscriptions","organizations_url":"https://api.github.com/users/craigspaeth/orgs","repos_url":"https://api.github.com/users/craigspaeth/repos","events_url":"https://api.github.com/users/craigspaeth/events{/privacy}","received_events_url":"https://api.github.com/users/craigspaeth/received_events","type":"User","site_admin":false},"created_at":"2016-02-05T17:41:37Z","updated_at":"2016-02-05T17:41:37Z","body":"Looks great! I think it'll be interesting to see how we solve the caching challenge with user authenticated endpoints. I definitely support not tackling that now and leaving it uncached though. One thing to keep in mind when we do cross that bridge—considering endpoints that return different responses based on role, e.g. the `:all` json vs `:public` json. Naively my gut would say to just add the user's id to the cache key... but there's only [two hard things](http://martinfowler.com/bliki/TwoHardThings.html) in computer science."}}