Disable caching of an individual template

EMGPOWERED
EMGPOWERED
@emg-powered
5 years ago
17 posts
I have a page which uses the jrCore_list function to list handpicked artist profiles and tracks, and I have the ordering set to random. My problem is that the ordering doesn't change unless the caches are reset.

My question is, is there a way to disable caching of an individual template so that the ordering always changes every time the page is visited? I know about the no_cache parameter, but I understand that it won't work since the outer template containing the jrCore_list call may be cached. I tried using the smarty nocache function as well, wrapping it around the contents of the outermost template, but that still didn't work.

Any help with this would be greatly appreciated. Thanks!
updated by @emg-powered: 05/19/19 12:16:50AM
paul
@paul
5 years ago
4,326 posts
You should just be able to put "no_cache=true" inside the jrCore_list that is creating the random list. What is the 'outer template' that you think is cached? Does that contain a jrCore_list call as well? If so, try applying the no_cache=true to that as well.


--
Paul Asher - JR Developer and System Import Specialist
brian
@brian
5 years ago
10,148 posts
Make sure and disabled the "Full Page Caching" option in the Core global config.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
EMGPOWERED
EMGPOWERED
@emg-powered
5 years ago
17 posts
paul:
You should just be able to put "no_cache=true" inside the jrCore_list that is creating the random list. What is the 'outer template' that you think is cached? Does that contain a jrCore_list call as well? If so, try applying the no_cache=true to that as well.

The outer template is a wrapper template that instantiates the variables needed in the template for that section. The outside template of that template just includes said template, and the header and footer templates.

brian:
Make sure and disabled the "Full Page Caching" option in the Core global config.

Full Page Caching was not disabled.
michael
@michael
5 years ago
7,715 posts
EMGPOWERED:
brian:
Make sure and disabled the "Full Page Caching" option in the Core global config.

Full Page Caching was not disabled.
Brian is saying to disable full page caching.
EMGPOWERED
EMGPOWERED
@emg-powered
5 years ago
17 posts
Sorry, I meant to say that it was not enabled. It was disabled.
EMGPOWERED
EMGPOWERED
@emg-powered
5 years ago
17 posts
Still having an issue with this. Full Page Caching is disabled and no_cache=true is set in the jrCore_list call, so, we're not sure why it's still caching the results...
michael
@michael
5 years ago
7,715 posts
That's how you do it. Need steps to setup a structure that doesn't work on my dev machine to know anything further.

The other thing you could try is to load that section that you want to always change by ajax.

make a call to a url that JUST contains the info you want to show:
yoursite.com/some_always_changing_info

in some_always_changing_info.tpl put your jrCore_list call with the no_cache=true
{jrCore_list module="jrSomething" no_cache=true}
Then use ajax to load that into the div on the main page.

StackOverflow: "How do I load the ajax data into a div with jquery?"
https://stackoverflow.com/questions/25676851/how-do-i-load-the-ajax-data-into-a-div-with-jquery
brian
@brian
5 years ago
10,148 posts
This isn't going to work since all skin template views are cached. To be honest this has never come up before.
The only way I can think to do this is with a small custom module that lets you define templates that won't be cached.

I think it would be pretty simple and straight forward - if you're interested in a custom module shoot us an email to support and we can follow up there.

Thanks!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net