Skip to content
This repository has been archived by the owner on Nov 2, 2019. It is now read-only.

Create API Data Cache Service #96

Open
maxdumas opened this issue Apr 27, 2015 · 2 comments
Open

Create API Data Cache Service #96

maxdumas opened this issue Apr 27, 2015 · 2 comments

Comments

@maxdumas
Copy link
Member

Instead of always pulling directly from the API, establish (or find) a service that that will cache our resources loaded from the API on the front-end, so that we can comfortably make tiny requests with impunity. A great use case for this is to simply look up the information needed to display a linked field by its rules under #71, instead of just showing its ID. It seems a bit wasteful to do that for every linked field, but if that data is then stored to be useful later, it's not so bad.

@ethanresnick
Copy link
Member

@maxdumas Have I mentioned ember data? It does this automatically :)

@maxdumas
Copy link
Member Author

We can do this very easily as it turns out! Although this is URL-based; it's not intelligent to the resource we're fetching, so a fetch of a single resource won't look up a previous fetch of the whole collection. It's still definitely an improvement, though, and we could get that behavior by maybe making a very simple wrapper on top of this.

https://github.com/mgonto/restangular#can-i-cache-requests

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants