Title: Gallery Cache tips
Last modified: October 20, 2020

---

# Gallery Cache tips

 *  [miroslavps](https://wordpress.org/support/users/miroslavps/)
 * (@miroslavps)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/gallery-cache-tips/)
 * 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](https://wordpress.org/support/users/pasyuk/)
 * (@pasyuk)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/gallery-cache-tips/#post-13559166)
 * 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](https://wordpress.org/support/users/miroslavps/)
 * (@miroslavps)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/gallery-cache-tips/#post-13560682)
 * 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](https://wordpress.org/support/users/pasyuk/)
 * (@pasyuk)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/gallery-cache-tips/#post-13564749)
 * The code in a previous post is for clearing cache when somebody vote the image.
   It is not disable cache completely.
 *  Thread Starter [miroslavps](https://wordpress.org/support/users/miroslavps/)
 * (@miroslavps)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/gallery-cache-tips/#post-13566355)
 * Thanks!
 *  Thread Starter [miroslavps](https://wordpress.org/support/users/miroslavps/)
 * (@miroslavps)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/gallery-cache-tips/#post-13568811)
 * And one more question, is there a hook or filter to call after the gallery is
   loaded?
    Regards!
 *  Thread Starter [miroslavps](https://wordpress.org/support/users/miroslavps/)
 * (@miroslavps)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/gallery-cache-tips/#post-13569037)
 * PS my goal is to modify the tags.
    Regards!
 *  Plugin Author [Serhii Pasyuk](https://wordpress.org/support/users/pasyuk/)
 * (@pasyuk)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/gallery-cache-tips/#post-13587951)
 * 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.

 * ![](https://ps.w.org/grand-media/assets/icon-256x256.png?rev=1484725)
 * [Gmedia Photo Gallery](https://wordpress.org/plugins/grand-media/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/grand-media/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/grand-media/)
 * [Active Topics](https://wordpress.org/support/plugin/grand-media/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/grand-media/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/grand-media/reviews/)

## Tags

 * [cache](https://wordpress.org/support/topic-tag/cache/)
 * [galleries](https://wordpress.org/support/topic-tag/galleries/)

 * 7 replies
 * 2 participants
 * Last reply from: [Serhii Pasyuk](https://wordpress.org/support/users/pasyuk/)
 * Last activity: [5 years, 7 months ago](https://wordpress.org/support/topic/gallery-cache-tips/#post-13587951)
 * Status: not resolved