MINOR Cache oEmbed results for a week (rather than an hour) by default, to avoid synchronous querying of potentially slow and unreliable external services upon page rendering

This commit is contained in:
Ingo Schommer 2012-06-08 18:28:55 +02:00
parent 2ecd8a0cc4
commit f7ac4e34e7

View File

@ -80,8 +80,8 @@ class Oembed {
* @returns string/bool Oembed URL, or false.
*/
protected static function autodiscover_from_url($url) {
// Fetch the URL
$service = new RestfulService($url);
// Fetch the URL (cache for a week by default)
$service = new RestfulService($url, 60*60*24*7);
$body = $service->request();
if(!$body || $body->isError()) {
return false;
@ -216,8 +216,8 @@ class Oembed_Result extends ViewableData {
return;
}
// Fetch from Oembed URL
$service = new RestfulService($this->url);
// Fetch from Oembed URL (cache for a week by default)
$service = new RestfulService($this->url, 60*60*24*7);
$body = $service->request();
if(!$body || $body->isError()) {
$this->data = array();