zooniverse / json-api-client

Apache License 2.0
10 stars 5 forks source link

Test caches for linked resources #2

Closed edpaget closed 9 years ago

edpaget commented 9 years ago

Make sure linked resources are being loaded from resources caches if they exist.

Some links are only defined by a URL so this double caches resources by id and by their href element if it exists. This takes care of caching avatars if they're queried for using ?include=avatar

Previously the code to fetch a linked resource was busting the resource cache by passing an additional non-ID argument 'query' that was usually undefined. This forced the client to re-request for the resource instead of loading it from the cache by id.

edpaget commented 9 years ago

This doesn't take care of ?include=owner since the user resource isn't including the href element at the moment. I'll update the API to make sure every resource is returning an href element.

brian-c commented 9 years ago

Thanks, published as 0.2.11.

Also I just transferred ownership of the repo to zooniverse so everybody can play along.