Title: Random posts with page cache
Last modified: July 4, 2018

---

# Random posts with page cache

 *  Resolved [wpkiller](https://wordpress.org/support/users/wpkiller/)
 * (@wpkiller)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/random-posts-with-page-cache/)
 * Dear Nick,
 * Thanks again for a great plugin. I’m using it on a client’s front page set to
   show 5 random posts.
 * The thing is that with W3TC using page cache – the random won’t work. I had to
   instruct W3 to not cache the frontpage all together in order for the random to
   work. This results of course in higher response times for the frontpage.
 * Any easy workaround maybe? I understand there’s a solution using jQuery or something,
   but I’m not a full stack programmer unfortunately. At least not yet. 🙁
 * TIA.

Viewing 15 replies - 1 through 15 (of 19 total)

1 [2](https://wordpress.org/support/topic/random-posts-with-page-cache/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/random-posts-with-page-cache/page/2/?output_format=md)

 *  Plugin Author [oceanwp](https://wordpress.org/support/users/oceanwp/)
 * (@oceanwp)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/random-posts-with-page-cache/#post-10463061)
 * Hello, sorry but it seems to be a cache issue not a problem with the plugin.
 *  Thread Starter [wpkiller](https://wordpress.org/support/users/wpkiller/)
 * (@wpkiller)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/random-posts-with-page-cache/#post-10464131)
 * Correct. I didn’t say it’s a problem with the plugin. Thought you might have 
   a workaround. Maybe excluding a js file or something.
    Thanks anyway.
 *  Plugin Author [oceanwp](https://wordpress.org/support/users/oceanwp/)
 * (@oceanwp)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/random-posts-with-page-cache/#post-10466519)
 * Ah ok 🙂
    Try to exclude this script: /wp-content/plugins/ocean-posts-slider/
   assets/js/main.min.js
 *  Thread Starter [wpkiller](https://wordpress.org/support/users/wpkiller/)
 * (@wpkiller)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/random-posts-with-page-cache/#post-10468336)
 * Unfortunately, there’s no way to exclude a js under page cache. 🙁
    I’m using
   Autoptimize for minification. Tried to exclude the js there, but then the whole
   posts slider was gone.
 *  Plugin Author [oceanwp](https://wordpress.org/support/users/oceanwp/)
 * (@oceanwp)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/random-posts-with-page-cache/#post-10470204)
 * Hi, can you send me the page url where you have the problem?
 *  Thread Starter [wpkiller](https://wordpress.org/support/users/wpkiller/)
 * (@wpkiller)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/random-posts-with-page-cache/#post-10473602)
 * Sure. here: [https://www.thebp.co.il](https://www.thebp.co.il)
 *  Plugin Author [oceanwp](https://wordpress.org/support/users/oceanwp/)
 * (@oceanwp)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/random-posts-with-page-cache/#post-10477505)
 * Hi, your caching plugin is activated? Because it works on my side.
 *  Thread Starter [wpkiller](https://wordpress.org/support/users/wpkiller/)
 * (@wpkiller)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/random-posts-with-page-cache/#post-10477840)
 * Sure. 🙂
    As I said, I’m turning off the page cache for the front page (there’s
   such a feature in W3TC).
 *  Plugin Author [oceanwp](https://wordpress.org/support/users/oceanwp/)
 * (@oceanwp)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/random-posts-with-page-cache/#post-10481771)
 * Hi, I reloaded the page several times, there are no issues, the slider is displayed
   every time.
 *  Thread Starter [wpkiller](https://wordpress.org/support/users/wpkiller/)
 * (@wpkiller)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/random-posts-with-page-cache/#post-10485304)
 * Sure. I’ll say it for the 3rd time – I’ve disabled the page cache for the front
   page.
    That’s why you don’t see any problem.
 * If you want, maybe we should set a time frame for me to bring the cache back 
   so you can see it.
 *  Plugin Author [oceanwp](https://wordpress.org/support/users/oceanwp/)
 * (@oceanwp)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/random-posts-with-page-cache/#post-10485309)
 * You need to activate it, otherwise, I don’t see if there is a problem. I have
   some minutes now, if you activate it, maybe I can see if there is a JS error 
   in the console.
 *  Thread Starter [wpkiller](https://wordpress.org/support/users/wpkiller/)
 * (@wpkiller)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/random-posts-with-page-cache/#post-10485321)
 * Great, I’ve activated it now.
    There are indeed several errors for onloadwff.
   js file.
 *  Plugin Author [oceanwp](https://wordpress.org/support/users/oceanwp/)
 * (@oceanwp)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/random-posts-with-page-cache/#post-10485323)
 * It doesn’t work on your side? I checked your site, it works, the slider is displayed.
 *  Thread Starter [wpkiller](https://wordpress.org/support/users/wpkiller/)
 * (@wpkiller)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/random-posts-with-page-cache/#post-10485327)
 * It is displayed. But it’s set to random. So every page refresh should show different
   posts. But iot will always show the same posts while cache is on.
 *  Plugin Author [oceanwp](https://wordpress.org/support/users/oceanwp/)
 * (@oceanwp)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/random-posts-with-page-cache/#post-10485331)
 * Ah yes. Have you tried another caching plugin? Like WP Fastest Cache? Or I recommend
   WP Rocket, which for me the best caching plugin ou there.

Viewing 15 replies - 1 through 15 (of 19 total)

1 [2](https://wordpress.org/support/topic/random-posts-with-page-cache/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/random-posts-with-page-cache/page/2/?output_format=md)

The topic ‘Random posts with page cache’ is closed to new replies.

 * ![](https://ps.w.org/ocean-posts-slider/assets/icon-256x256.png?rev=2670323)
 * [Ocean Posts Slider](https://wordpress.org/plugins/ocean-posts-slider/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ocean-posts-slider/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ocean-posts-slider/)
 * [Active Topics](https://wordpress.org/support/plugin/ocean-posts-slider/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ocean-posts-slider/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ocean-posts-slider/reviews/)

## Tags

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

 * 19 replies
 * 2 participants
 * Last reply from: [oceanwp](https://wordpress.org/support/users/oceanwp/)
 * Last activity: [7 years, 11 months ago](https://wordpress.org/support/topic/random-posts-with-page-cache/page/2/#post-10489611)
 * Status: resolved