Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document caching behavior of store methods. #4733

Closed
6 tasks done
rwjblue opened this issue Jan 3, 2017 · 10 comments
Closed
6 tasks done

Document caching behavior of store methods. #4733

rwjblue opened this issue Jan 3, 2017 · 10 comments
Assignees
Labels
🏷️ doc This PR adds/improves/or fixes documentation

Comments

@rwjblue
Copy link
Member

rwjblue commented Jan 3, 2017

It is my understanding that this.store.query and this.store.queryRecord will never be cached (they will always do a request), but the documentation does not state that (at least during my quick perusal).

We should update the documentation for all of the primary methods to indicate what will happen for repeated calls (do they return prior results, do they always trigger an XHR, etc):

This API documentation should probably also link to the corresponding shouldBackgroundReload type docs that explain how to tweak/modify the behavior.

@bmac bmac self-assigned this Jan 3, 2017
@ryanlabouve
Copy link
Contributor

Can I help with doing this? Maybe I could start with store.query and store.queryRecord?

@locks
Copy link
Contributor

locks commented Jan 15, 2017

@ryanlabouve please do! 🙏

@runspired
Copy link
Contributor

@rwjblue They are cached, they just never return from cache. Yes, we should document this :)

@GCheung55
Copy link

@runspired if they never return from cache then what's the reason for caching?

@locks
Copy link
Contributor

locks commented Jan 19, 2017

@GCheung55 because you might want to peekRecord or peekAll afterwards, and if the record is already in the store, you get it back :D

@runspired
Copy link
Contributor

@GCheung55 so that belongsTo, hasMany, peekAll peekRecord and findRecord continue to work like they should :P

@ryanlabouve
Copy link
Contributor

ryanlabouve commented Jan 20, 2017

Starting with query, I'm wanting to double check my understand of what's happening. If this is right, I'll work on wording and PR:

The results of query are cached (source) in the store, however each time this method is called a new request is made (source).

Should I add something about why these are cached? (as @runspired / @locks ) points out above)?

ryanlabouve added a commit to ryanlabouve/data that referenced this issue Jan 20, 2017
bmac pushed a commit that referenced this issue Jan 23, 2017
* Document cache/request behavior of `query` #4733

* Update on PR feedback
@ryanlabouve
Copy link
Contributor

We looked at peekAll and it seems like it answers the caching questions well.

@jonpitch is going to PR on peekRecord.

@ryanlabouve
Copy link
Contributor

The documentation on findAll and findRecord seem to answer some of the questions in the original issue. There are sections about reloading, but they do not link to other docs.

@mixonic
Copy link
Member

mixonic commented Mar 30, 2017

Boxes checked off, closing this!

@mixonic mixonic closed this as completed Mar 30, 2017
@runspired runspired added 🏷️ doc This PR adds/improves/or fixes documentation and removed Documentation labels Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ doc This PR adds/improves/or fixes documentation
Projects
None yet
Development

No branches or pull requests

7 participants