• Resolved Paul Ryan

    (@figureone)


    Aloha @pavex,

    We noticed that the html markup for the albums will get refreshed whenever the page the shortcode is embedded in gets updated (save_post hook).

    However, we have some users that frequently update their albums in Google, but rarely update their page in WordPress where the album is embedded. This means the embedded album gets stale, and does not show the latest version from Google.

    Would it be possible to set an expiration on the transient that caches the album html? We suggest using the WordPress constant DAY_IN_SECONDS so the cache gets refreshed every 24 hours.
    https://developer.www.ads-software.com/reference/functions/set_transient/

    Change line 102 of pavex-embed-google-photos-album.php to:
    set_transient($transient, $html, DAY_IN_SECONDS);

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author pavex

    (@pavex)

    Hi Paul,
    I’ve experimentally added a cache expiration option (in version 2.0.8). You must add a parameter to shortcode with timeout in seconds. Personally, I would set more than 24 hours. Check short plugin documentation to more details.

    • This reply was modified 5 years, 6 months ago by pavex.
    Thread Starter Paul Ryan

    (@figureone)

    Tested and looks good. Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Refresh cached album contents daily’ is closed to new replies.