lpaulsen93 / dokuwiki-plugin-odt

Exports a page to the Open Document format used by OpenOffice.org and other word processors
http://www.dokuwiki.org/plugin:odt
13 stars 26 forks source link

Can't disable cache #303

Open eduardomozart opened 1 year ago

eduardomozart commented 1 year ago

The plugin seems to use a similar logic to DW2PDF to check cache availability, as can be seen in: https://github.com/lpaulsen93/dokuwiki-plugin-odt/blob/7fe18af1f74963aa355252487538d8e9671863f7/action/export.php#L200

But there's no button to enable/disable ODT cache functionality and even implementing it I wasn't able to disable it completely (it always download from cache instead of generating a new ODT file each try).

Klap-in commented 1 year ago

The dw2pdf plugin has the config setting usecache to let in the Config Manager select the preference. This can be copied from that plugin, including translated strings.

Klap-in commented 1 year ago

Indeed, the odt plugin copied a big part of the export function from dw2pdf plugin.

eduardomozart commented 1 year ago

Yes, I tried to use that but I was unable to disable the cache, it always downloaded the file from cache instead of regenerating the ODT file, even if usecache is false or using ~~NOCACHE~~ on page (not sure if it's intended to not use cache if ~~NOCACHE~~ is set). Dw2PDF offer an option on it's plugin administration page to set usecache option directly on plugin properties. I attempted to recreate it on ODT plugin and I was able to change it's option value, but even when usecache is false, it's still downloading the cached file instead of generating a new ODT one, but the cache seems to be ignored and the ODT is regenerated when changing the directive 'css_template' of the plug-in.

Klap-in commented 1 year ago

~nocache~ is for DokuWiki to instruct the renderer. So it will not change the caching of the export. I maintain the dw2pdf plugin, so I seen quite a bit of that code. Do you have somewhere a branch with this code? Then I can have a look.

eduardomozart commented 1 year ago

I'll recreate my draft adding the odt>usecache directive to ODT plug-in again and send you a PR for us to debug it. I compared it with DW2PDF cache control mechanism that uses a logic similar to usecache from ODT plug-in but I was unable to figure out why DW2PDF cache is disabled when dw2pdf>usecache is disabled on plug-in settings but when disabling odt>usecache it's still downloading ODT file from cache.