• Hi guys!
    I have few questions and would like a opinion about my the galleries in my site.

    First the question – in Settings > Other Settings, what is the unit for Cache expiration, hours, days, months?

    I have a custom page and thanks to the support here, and in it I have list with most liked photos.

    I want to refresh the most liked photos gallery after each vote, not when the cache expire, or when go to the gallery and click save button.
    How can I do this, is there something in the settings I can use, or have to create custom cron job to clear the cache by gallery ID for example.

    Regards and thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Serhii Pasyuk

    (@pasyuk)

    Cache expiration is in hours. So if you want to see fresh data on your most liked photos after each vote you can set Cache expiration to 0 or add code below to your theme’s functions.php file:

    add_action( 'gmedia_rate', function( $image_id ) {
    	gmedia_delete_transients( 'gm_cache' );
    } );
    Thread Starter miroslavps

    (@miroslavps)

    Thanks!
    And just to understand, this action will do same as I set the cache expiration to 0, or will affect the votes only?
    I do not want to stop completely stop the cache, the only dynamic thing it them are the votes, and there are not much of them.

    Regards!

    Plugin Author Serhii Pasyuk

    (@pasyuk)

    The code in a previous post is for clearing cache when somebody vote the image. It is not disable cache completely.

    Thread Starter miroslavps

    (@miroslavps)

    Thanks!

    Thread Starter miroslavps

    (@miroslavps)

    And one more question, is there a hook or filter to call after the gallery is loaded?
    Regards!

    Thread Starter miroslavps

    (@miroslavps)

    PS my goal is to modify the tags.
    Regards!

    Plugin Author Serhii Pasyuk

    (@pasyuk)

    There is no any event after gallery loaded. What you want to modify in tags? Perhaps it’s could be done with CSS.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Gallery Cache tips’ is closed to new replies.