change filter cache lifetime for a specific filter?

change filter cache lifetime for a specific filter?

de tim st.clair -
Número de respuestas: 4
Imagen de Particularly helpful Moodlers Imagen de Plugin developers

In Filters >Common filter settings there is a setting for Text cache lifetime. This is great, but I'd like to be able to set it for a given filter - so that some have none, and others have high values. Is this possible to set or override in my filter code somehow?

Promedio de valoraciones: -
En respuesta a tim st.clair

Re: change filter cache lifetime for a specific filter?

de Michelle Jackman -

Bumping this up because I'd like to find out if there's a way too!

We have the Poodll audio/video recording add-on but it won't work reliably on our system because we have the text cache lifetime set at 15 minutes. We have quite a large site and don't think our host will be willing to change it for us. If we could just change it for the one filter, however....

En respuesta a Michelle Jackman

Re: change filter cache lifetime for a specific filter?

de Louise Spencer -

Here at University of South Australia we also have a need to set the cache lifetime to none for one filter but not the others. Would like to know if there is a way of coding an override for that particular filter.

En respuesta a Louise Spencer

Re: change filter cache lifetime for a specific filter?

de Tim Hunt -
Imagen de Core developers Imagen de Documentation writers Imagen de Particularly helpful Moodlers Imagen de Peer reviewers Imagen de Plugin developers

Short answer no.

Longer answer, the filter cache was removed in Moodle 2.7, and instead, those filters that need it do their own caching, so from Moodle 2.7 onwards, your question becomes unnecessary.

En respuesta a Louise Spencer

Re: change filter cache lifetime for a specific filter?

de Fred Woolard -

Assuming this issue is related to your reply in the Flowplayer HTML5 topic, the likely reason the JW player is not loaded when filter caching is enabled is the filter's Javascript module is not loaded/initialized because while the filter's output is cached, the call it makes to $PAGE->requires->js() is not cached.

The PHP call to $PAGE->requires->js() is how the Moodle page knows to emit the <script> tag to fetch the jwplayer.js file containing the code to construct the player. The problem can be corrected in the filter_jwplayer by making the <script> tag part of the filter output when caching is enabled, but that's only necessary if you need to remain with the Moodle version you have now.

Otherwise, as Tim mentions, the problem is eliminated once you get to Moodle 2.7.