As a result from issue #2262589: Add a maximum lifetime for a retrieved image I decided to add a hook so that other modules can decide whether or not the image should be re-fetched.
I also added some documentation on how to use it:

<?php
/**
 * Add custom image refresh logic.
 *
 * Use this hook to add extra validation(s) whether to refresh images.
 */
function hook_imagecache_external_needs_refresh_alter(&$needs_refresh, $filepath) {
  // Example: refresh images at least once a week.
  if (filemtime($filepath) > REQUEST_TIME - 60 * 60 * 24 * 7) {
    $needs_refresh = TRUE;
  }
}
?>
CommentFileSizeAuthor
#2 added_hook_to_alter-2625294-2.patch2.22 KBBarisW
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

BarisW created an issue. See original summary.

BarisW’s picture

Status: Active » Fixed
FileSize
2.22 KB

Here's a patch for reference. Already committed.

  • BarisW committed 7603d50 on 7.x-2.x
    Issue #2625294 by BarisW: Added hook to alter image fetching logic --...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.