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
Best Regards,
Darko`
@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
@nick6352683 If you want NOT to cache widgets, there is a great small plugin here to Ajaxize a widget IF it supports shortcodes.
@dimalifragis thanks for your suggestions, I will definitely check them out.
… 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.
Excluding certain objects from the page itself will have massive performance hit and that is not the goal of this plugin.
As @dimalifragis mentioned you can try loading the dynamic results with ajax.