How would you display a random image from a gallery field (img src or bg img) using a cache-proof method? In other words, the image needs to load randomly on each refresh.
You can’t prevent a browser from caching a page. Outputting HTML with a new random image every time would depend on what server side cache you’re using. It may be possible with some but you’d need to look into the cache that you’re using. The might be able to load the image using AJAX, but you’d need to vary the URL that is requested each time as well so that the browser thinks it’s getting something different.
Someone offered up this REST API and AJAX solution.Haven’t been able to test it yet. https://gist.github.com/airesvsg/2710de81f09613c456277ae3e38c2358