Topic on Project:Support desk

How to disable cache for specific extension in 1.33

4
Chan15tw (talkcontribs)

I wrote a extension for one wiki page to connect to some outside url, I just put <changelog /> in that artcile, it will hook to my extension to call Changelog.php to execute Changelog::getLog()

getLog method will do curl connect to my outside url to get json content and re-format it to html string and return, they work perfectly in 1.27, but after I upgrade to 1.33, it still get the content I want, but it cached the result, when outside url changes content it won't go with it, I need to edit article and save to get new content again, I try to add


$cache = new CacheHelper();

$cache->setCacheEnabled(false);


in getLog function was not change anything, how to disable cache on the page which use this extension

Bawolff (talkcontribs)

You should probably not touch the CacheHelper class.

In your extension, call $parser->disableCache();

Chan15tw (talkcontribs)

* @deprecated since 1.28; use getOutput()->updateCacheExpiry()


it's deprecated, and I tried both $parser->getOutput()->updateCacheExpiry(0); and $parser->disableCache(); in my method still got old content

Bawolff (talkcontribs)

have you made an edit to the page since changing the method (to clear the cache so the new non cached code can be run)

Is the request resulting in a 200 or a 304 response code?

If you look at the html source of the page, there should be html comments with details on caching. What do they say?

Reply to "How to disable cache for specific extension in 1.33"