Title: Don&#8217;t cache certain objects?
Last modified: November 28, 2020

---

# Don’t cache certain objects?

 *  Resolved [nick6352683](https://wordpress.org/support/users/nick6352683/)
 * (@nick6352683)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/dont-cache-certain-objects/)
 * Is there a way to manage what objects not to be cached?
 * For example I have an ACF Block which displays randomly an image from a number
   of images submitted by the web designer. The script gets the url of the random
   image and displays it on the site. Of course when the page is cached, the php
   script is executed just the first time during the cache generation, so you always
   get the same image.
 * Is there a way to tell Rapid Cache not to cache a certain Gutenberg Block for
   example?

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [MegaOptim](https://wordpress.org/support/users/megaoptim/)
 * (@megaoptim)
 * [5 years ago](https://wordpress.org/support/topic/dont-cache-certain-objects/#post-14431179)
 * Hello,
 * I know this is old question, but let me answer it, so in case anyone still needs
   help on this issue.
 * To answer your question. This is not possible. Certain objects or widgets can
   not be excluded from caching because the whole page is stored into the cache.
 * The most you can make is to hook into **dynamic version salt** filters and adjust
   the cache expiration based on your needs for specific page or based on specific
   condition.
 * [https://github.com/megaoptim/rapid-cache/wiki/Dynamic-Version-Salts](https://github.com/megaoptim/rapid-cache/wiki/Dynamic-Version-Salts)
 * Best Regards,
    Darko`
 *  [dimal](https://wordpress.org/support/users/dimalifragis/)
 * (@dimalifragis)
 * [5 years ago](https://wordpress.org/support/topic/dont-cache-certain-objects/#post-14471676)
 * [@megaoptim](https://wordpress.org/support/users/megaoptim/) Litespeed cache (
   free) does offer that option, to exclude widgets from caching.
 * Also Fastest Cache PRO (paid) offers that.
 * Both are using mod_rewrite for serving, you use php. Is that a block?
 * Thanks
 *  [dimal](https://wordpress.org/support/users/dimalifragis/)
 * (@dimalifragis)
 * [5 years ago](https://wordpress.org/support/topic/dont-cache-certain-objects/#post-14471689)
 * [@nick6352683](https://wordpress.org/support/users/nick6352683/) If you want 
   NOT to cache widgets, there is a great small plugin here to Ajaxize a widget 
   IF it supports shortcodes.
 *  Thread Starter [nick6352683](https://wordpress.org/support/users/nick6352683/)
 * (@nick6352683)
 * [5 years ago](https://wordpress.org/support/topic/dont-cache-certain-objects/#post-14471773)
 * [@dimalifragis](https://wordpress.org/support/users/dimalifragis/) thanks for
   your suggestions, I will definitely check them out.
 *  Thread Starter [nick6352683](https://wordpress.org/support/users/nick6352683/)
 * (@nick6352683)
 * [5 years ago](https://wordpress.org/support/topic/dont-cache-certain-objects/#post-14471777)
 * … and yes, I am trying not to cache certain ACF blocks, for this reason.
 * Some of my blocks are given an array of images, that with php a random one is
   picked and it’s url is returned. Therefore with every page load a different image
   is to be displayed. When I apply caching to the page, the cache plugin creates
   a static html code for the site and keeps displaying the html code until the 
   cache expires and generates a new one, resulting in displaying the same image
   with every page load, until the cache expires, and a new one is created.
 * Ultimately I need to find a cache plugin (if such exists) to indicate on a block
   basis not to be cached, so in my case, for the images, I can have a randomly 
   generated image with each page load, while the rest of the page will be cached.
 *  Plugin Author [MegaOptim](https://wordpress.org/support/users/megaoptim/)
 * (@megaoptim)
 * [4 years, 12 months ago](https://wordpress.org/support/topic/dont-cache-certain-objects/#post-14491288)
 * Excluding certain objects from the page itself will have massive performance 
   hit and that is not the goal of this plugin.
 * As [@dimalifragis](https://wordpress.org/support/users/dimalifragis/) mentioned
   you can try loading the dynamic results with ajax.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Don’t cache certain objects?’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/rapid-cache_2c3680.svg)
 * [Rapid Cache](https://wordpress.org/plugins/rapid-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/rapid-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/rapid-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/rapid-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/rapid-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/rapid-cache/reviews/)

 * 6 replies
 * 3 participants
 * Last reply from: [MegaOptim](https://wordpress.org/support/users/megaoptim/)
 * Last activity: [4 years, 12 months ago](https://wordpress.org/support/topic/dont-cache-certain-objects/#post-14491288)
 * Status: resolved