Cache problems

Re: Cache problems

by Johnny Zephyr -
Number of replies: 0

 Hi

 I'm looking to create a plugin that will retrieve data from the database per user from a custom table. I have used the internal $db but am finding that in order to get a result i have to 'purge all caches' each time. I'm having the caching problem as well,

 My plugin is similar to the 'label' plugin except the name is dynamic; it changes depending on the results retrieved from my custom table. So users will log in and view a course and that 'label' will change depending on who they are... so user 1 may see 'xyz' and user 2 may see '123'. Just to clarify, this all happens on the course 'view' page.

 I'm at the stage where once the 'label' has been set, only a 'purge all caches' will query the db again and update 'labels' - this isn't fit for purpose as learners can't do this.

 How do we go about disabling the cache for this one plugin if possible?

 I've disabled every other cache in moodle that I know of from the caching plugin. I've disabled browser caches etc... but the only thing that works is that overall purge. I'm upgrading from 1.9 to 2.7 so alot has changed. I don't want to 'inject' code in the middle of a format as i wanted to try the plugin/newmodule out.

 Any help is welcomed and much appreciated.

 Thanks