Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Cache relations #149

Open
JN-Jones opened this issue May 22, 2015 · 1 comment
Open

Cache relations #149

JN-Jones opened this issue May 22, 2015 · 1 comment

Comments

@JN-Jones
Copy link
Contributor

Laravel caches (as always) nothing, so the following code will run the same query three times:

$forum = Forum::find(1);

$forum->parent;
$forum->parent;
$forum->parent;

while the following code will do the same but run the query only once:

$forum = Forum::find(1);

Forum::find($forum->parent_id);
Forum::find($forum->parent_id);
Forum::find($forum->parent_id);
@JN-Jones JN-Jones added this to the Alpha 1 milestone May 22, 2015
@wpillar wpillar modified the milestones: Beta 1, Alpha 1 Aug 23, 2015
@wpillar
Copy link
Contributor

wpillar commented Aug 23, 2015

Moving this to Beta 1 milestone, not essential for Alpha releases as it's an optimisation.

@JN-Jones JN-Jones mentioned this issue Oct 27, 2015
8 tasks
@euantorano euantorano removed this from the Beta 1 milestone Apr 26, 2016
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

3 participants