bwakad Posted April 1, 2014 Share Posted April 1, 2014 I don't know exactly where I read it, but it was saying that find() is less heavy as get(). Then I also notice some people are able to tell what is heavier for server requests. Now, looking at my selector - which fetch all children of children - I would like to know how you can tell if this is good practise, considering speed and request. And by what program you can tell. $myparent = $pages->find("parent=/province/"); foreach ($pages->find("parent=$myparent") as $value) { echo $value->title; } Link to comment Share on other sites More sharing options...
kongondo Posted April 1, 2014 Share Posted April 1, 2014 find will find many (or even all!) things if they exist unless you limit it. This will put a strain on your servers and PHP may even timeout. get, will only get one thing...so, less resource hungry. The general rule is that when using find, you need to use limit=xx. You can always paginate your results if you need more to be fetched. But, if you are sure that the number of children will not grow, and that you have a set reasonable number of children, then you can avoid the limit 3 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now