Issue Type: Improvement Created: 2007-11-13T15:56:08.000+0000 Last Updated: 2012-11-20T20:53:31.000+0000 Status: Closed Fix version(s): Reporter: Menno Holtkamp (holtkamp) Assignee: None Tags: - Zend_Service_Flickr
Related issues: Attachments:
Currently, after performing a query in Flickr, one typically iterates over the results using:
<pre class="highlight">
$results = $flickr->tagSearch($tagQuery, $options);
foreach ($results as $result) {
echo $result->id;
echo $result->Thumbnail->uri;
//etc
}
Each result is of type Zend_Service_Flickr_Result. In the constructor of this class, additional image details are acquired by performing an additional query, and thus connecting to the Flickr servers:
<pre class="highlight">
foreach ($this->_flickr->getImageDetails($this->id) as $k => $v) {
$this->$k = $v;
}
When the result-set, as mentioned before, gets large, the amount of queries to the Flickr service also increase, decreasing overall performance. For example:
20 images are fetched. Using the basic search command, this requires only one query. But when processing the results, another 20 queries for image details are fired to the Flickr-servers. As a work-around in my web-application, I first send over the image-details to the browser (id, text, etc) and I send over some javascript which performs a new Ajax-call. This Ajax-call results in fetching the details of an image and filling in the src-attribute. of the already loaded skeleton of the image. Now the search takes me only a few miliseconds, after which the user receives a response from the webserver (the image skeletons), and THEN the images start to popup as a result of the Ajax-calls. A disadvantage of this solution is the increased server-load, caused by the various incoming ajax-requests for image details. Nevertheless it significantly decreases the time it takes to send back some result to the user
In summary: I would like to see the option to NOT fetch the imageDetails when processing the results, increasing initial performance and overall user-experience.
Posted by Menno Holtkamp (holtkamp) on 2007-11-13T15:57:09.000+0000
Some typo
Posted by Wil Sinclair (wil) on 2008-03-21T17:05:26.000+0000
This issue should have been fixed for the 1.5 release.
Posted by Wil Sinclair (wil) on 2008-04-18T13:12:05.000+0000
This doesn't appear to have been fixed in 1.5.0. Please update if this is not correct.
Posted by Wil Sinclair (wil) on 2008-06-09T12:41:27.000+0000
Please evaluate and fix/categorize as necessary.
Posted by Alexey Deriyenko (deriyenko) on 2009-04-23T09:33:50.000+0000
Hi, I'm quite new to ZF and this is my first comment, so I may be posting to a wrong place, please correct me if I'm wrong. I faced this problem in one of my projects, here is the proposed solution:
<pre class="highlight">
public function __get($name)
{
// parameters that are present in initial search result
if(in_array($name,array('id','owner','secret','server','title','ispublic','isfriend','isfamily')))
{
return $this->{$name};
}
else
{
foreach ($this->_flickr->getImageDetails($this->id) as $k => $v) {
$this->$k = $v;
}
}
return $this->{$name};
}
This method is to be added to Zend_Service_Flickr_Result and, obviously, we can remove this foreach loop in constructor.
I have also implemented flickr search by latitude/longitude and bounding box, is it possible to create a ticket and add the code there?
Thanks in advance for your help.
Posted by Rob Allen (rob) on 2012-11-20T20:53:31.000+0000
Bulk change of all issues last updated before 1st January 2010 as "Won't Fix".
Feel free to re-open and provide a patch if you want to fix this issue.