mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
2ecd8a0cc4
commit
f7ac4e34e7
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user