Permalink
Browse files

MINOR Cache oEmbed results for a week (rather than an hour) by defaul…

…t, to avoid synchronous querying of potentially slow and unreliable external services upon page rendering
  • Loading branch information...
chillu committed Jun 8, 2012
1 parent 2ecd8a0 commit f7ac4e34e76e7260feea2a81b7d4248d0c5a4ce2
Showing with 4 additions and 4 deletions.
  1. +4 −4 oembed/Oembed.php
View
@@ -80,8 +80,8 @@ protected static function matches_scheme($url, $scheme) {
* @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 @@ protected function loadData() {
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();

0 comments on commit f7ac4e3

Please sign in to comment.