First time here? Check out the FAQ!

GetObject Property Photos Timeout


I am using the PHRETS library and am able to query a filtered list of properties using the standard "Search" method on the PHRETS Session class, however when I try and fetch photos for each property using the "GetObject" method the request becomes unresponsive for anything more than 5 properties.

$photos = $session->GetObject('Property', 'Photo', $propertyId, '*');

Is there a way to batch these photo requests to make the query faster. We are trying to sync down ~40 properties and can only get images for ~5 properties at a time before the request times out. Our request timeout for Apache and PHP is set to 600 seconds.

Requesting only the properties w/o images returns a response in less than a few seconds. Is this a problem w/ the RETS server or is there anything I can do to help speed up the response times when querying photos for properties? I have used this identical code for other RETS servers w/o issue on a similar number of properties.

Please let me know if I can provide additional detail to help troubleshoot this.

Thanks, Trevor

trevor's avatar
asked 2021-06-18 13:40:37 -0500
edit flag offensive 0 remove flag close merge delete


add a comment see more comments

1 Answer


There are several ways to do this:
1. Media Resource search. This will return the image URLs for a listing. Then the URLs can be used to download the images if you need a local copy. This is the preferred method.
2. GETOBJECT Location=1. This will return the image URLs which can then be used to download the images if you need a local copy. You should be able to include multiple Listing IDs when getting the URLs without timeouts.
3. GETOBJECT Location=0 or not specified. This returns the actual image file. This method will probably go away sometime in the future to allow us to better support caching schemes. If you pull all images for a listing, you are probably best doing it one Listing at a time since they can have many images and sizes can vary.

bwolven's avatar
answered 2021-07-01 16:25:49 -0500
edit flag offensive 0 remove flag delete link


Thanks bwolven. Adding Location=1 allows us to reference the URL externally which significantly increased the response time of our interaction w/ the RETS server. Appreciate the help!

trevor's avatar trevor (2021-07-07 13:19:54 -0500) edit
add a comment see more comments

Your Answer

Login/Signup to Answer